Determination and control of activities of an emotional system

ABSTRACT

A method and subsystem, called method DKA, for determining and controlling activites of an emotional system, aS, which belongs to the class of autonomous, motivated agents and robots, is described. The method DKA determines the current motivation of the system aS to execute an activity. This motivation is determined by stimulus patterns in situation models, and intensities of satisfactions and desires, with regard to needs of the system aS. Priorities of activities of aS are determined by motivations. DKA controls sub-activities which, by orders of the system aS, are executed by other agents/robots. The method DKA can judge which objects, situations and activities are good (at present) and which are bad for aS. The used internal representation of the world of aS can contain very abstract situation models.  
     Emotional systems, steered by the method DKA, are especially suitable: for attending ill people, as artificial servants making housemaid works for routine services for clients.

1. INTRODUCTION

[0001] An emotional system, aS, is, in this description, a not biological system which consists of the following components:

[0002] WP—a subsystem for perception of objects and simple situations in the world of aS;

[0003] Bd(aS)—a set of needs of aS, e.g. AN—the need for recognition acknowledgment and self-esteem;

[0004] EBV—a system of rules and procedures which determine intensities of satisfactions and desires, with respect to the needs of aS;

[0005] SeG—a graph of object and situation models for objects and situations in the world of aS;

[0006] AM—a set of activities (e.g. activity schema, operations) which aS can execute;

[0007] KP—a set of cognitive procedures (some of these procedures belong to WP and to EBV);

[0008] DA—a subsystem for determining and controlling activities and orders/commands which aS executes;

[0009] Ex-contr-motion—a subsystem which executes motion activities of aS.

[0010] This paper presents a method (denoted by DKA, in this paper) which describes the subsystem DA and shows how system aS functions. A DKA—like method for steering the behavior of an agent or a robot has not been developed till now. Emotional system aS, determined by the method DKA, belongs to the class of autonomous, motivated agents and robots, and differs from other agent systems and robots in having the following properties: (i) the behavior of aS is determined (by the method DKA) by motivations which are determined by intensities of satisfactions and desires, and by stimulus patterns in situation models, with respect to needs in Bd(aS),—motivations of aS are determined in quite different way than in known agents and robots (s. e.g. Meystel & Albus [MeA] (2002), d'inverno & Luck [InL] (2001) and Muller [JMü] (1996)), (ii) by the method DKA, aS may simulate emotions, (iii) the method DKA handles urgent situations with appropriate high priority, (iv) the internal representation of the world of aS (connected with the method DKA) contains situation models of high abstraction levels (of low resolution levels, according to Meystel & Albus [MeA]), which do not occur in other actual agents and robots (s. e.g. [MeA], d'Inverno & Luck [InL] and Müller [JMü])—this enables to define semantics of simple sentences of a natural language (idea of such a semantics is given in Schurmann [AS4] (1999)), (v) the method DKA can judge which objects, situations and activities are good (at present time) and which are bad for the system aS. The method DKA determines the behavior of aS on the basis of: the needs, satisfactions and desires of aS, the internal representation of the world of aS and perceived objects and situations. Learning methods are not considered in this paper. However, the method DKA can judge how good or bad, for aS, are objects and situations, on the basis of changes of satisfactions and desires of aS, when these objects and situations are perceived. This possibility and the internal representation of the world of aS enable to build in learning methods into DKA that can be more effective than the learning methods given in Meystel & Albus [MeA]. Also cooperation of aS with other agents and robots, AR, are considered only incidentally—with which AR aS cooperates must follow from the models of these AR and activity schemas which aS has.

[0011] The author developed step by step the idea of an emotional system in the papers: [AS1] (1998), [AS2] (1998), [AS3] (1998), [AS4] (1999), [AS5] (2002), [AS6] (2002). Emotional systems aS are especially suitable: (i) for taking care of ill and old people, (ii) as artificial servants who make housemaid works, (iii) for routine services for clients, (iv) for representing virtual people and creatures in entertainment software.

[0012] The structure of this description: in Section 2 are given the notions needed for the description of the method DKA: intensities of satisfactions and desires, stimulus patterns and stimulus intensity, models of objects, situations and activities; the component SeG is defined. In Section 3 are described motivations of aS to execute activities, commands and sub-activities. Because DKA is connected with perception of objects and situations, a general specification of the perception subsystem WP (of aS) is given in Section 4. On the basis of Sections 2, 3 and 4, is described the method DKA (Section 5).

[0013] 2. Used Notions; Models of Objects, Situations and Activities

[0014] In this section I define notions needed for description of the method DKA.

[0015] 2.1. Satisfaction, Desire, Stimulus Patterns and Stimuli

[0016] Below in this paper, we use the following notions und functions described in my paper [AS5] (2002). Emotional system aS has a set Bd(aS) of needs. To Bd(aS) belong e.g. GR (to belong to a community), AN (for recognition, acknowledgment and self-esteem). The state of desire and satisfaction (or dissatisfaction) of aS, with regard to need b, at time t, is described by functions:

0≦des(aS,b,t)≦60, −30≦bef(aS,b,t)≦30, for b ∈ Bd(aS)

[0017] where des(aS,b,t) is the intensity of desire and bef(aS,b,t) the intensity of satisfaction of the need b at time L These functions have the following properties:

[0018] i. Increasing function bef(aS,b,t) means aS satisfies need b (positive stimulus) and is perceived by aS with approval, joy or happiness.

[0019] ii. When bef(aS,b,t)<0 and does not increase then aS perceives bef(aS,b,t) as a negative stimulus (disappointment, annoyance, sadness, suffering) with respect to need b. Decreasing values bef(aS,b,t)<0 mean stronger negative stimulus with regard to need b.

[0020] iii. des(aS,b,t) is the intensity of desire of aS to satisfy need b at time t The greater des(aS,b,t) the greater is the desire of aS to satisfy need b. des(aS,b,t)<0.5 means ‘need b of aS is well satisfied at time t’.

[0021] iv. The greater des(aS,b,t) the greater is the approval and joy of aS when bef(aS,b,t) increases, and the greater is the dissatisfaction, annoyance and grief of aS when bef(aS,b,t)<0 and decreases.

[0022] aS has models of objects and situations (OSM) of its world (described in Sect 2.2), and models of activities which vP can execute (described in Sect. 2.3).

[0023] Stimulus patterns. Expected changes of values bef(aS,b,t) and des(aS,b,t), caused by object or situation OSM, are represented in OSM by stimulus patterns of the following form:

([°|Nba,] fs(aS,b)=([°|p;]n; (y1z 1), . . . , (yn,zn); q ht)[°|/z eu][°|;OSM1.Ej][°|; if C])  (2.1)

[0024] where [tex1| . . . |texk] denotes one of the words tex1, . . . , texk, ° is the empty word, Nba and n are natural numbers, (1≦n≦10), fs denotes name of a stimulus pattern, 0≦p≦1, −30≦yi≦o30, −55≦zi≦60, yi and zi are simple arithmetical expressions, q ht denotes a time period (e g: 0.5 h, 3 days, 1 week), n* q ht≦720 h, z>0, eu denotes a measure (e g kg, g, h, km, m, I) and e.g./200 g denotes ‘pro 200 g’. Nba is increased by 1 when pattern (2.1) is applied. Nba/N is the probability that the pattern fs(aS,b)=( . . . ) is valid, where N is attached to the model OSM and increases by 1 when the model OSM is applied. C is a condition. If C occurs then [°|Nba,] fs(aS,b)=( . . . ) can be applied only if C is true. If OSM1.Ej occurs then the pattern fs(aS,b)=( . . . ) concerns the pattern Ej=(‘ds’,( . . . fse(aS,b)=( . . . ) . . . )) in OSM1. Example of a pattern (occurring in OSM):

epb(aS,b)=(n; (y1,z1), . . . , (yn,zn); q ht) [°|/z eu]  (2.2)

[0025] where(fs=epb) yn>1+y1 and z1>1+zn. The meaning: aS can execute (at time t) an activity, AV, such that when aS uses OSM in AV then aS expects that OSM will increase bef(vP,b,.) and decrease des(vP,b,.) according to the pattern (2.2). Exact description of all patterns and their meanings is given in Schurmann [AS5], Sect. 2.2.

[0026] In Schurmann [AS6] are given rules which determine the changes of values bef(aS,b,t) and des(aS, b,t), caused by objects and situations (OS), for some needs b. To perceive the stimuli of these objects and situations, appropriate stimulus patterns must be built in object and situation models, OSM, representing OS (OS is recognized as OSM). The new stimulus patterns occur in model OSM, as properties, in the following form

(‘dr’,Nb,stp(b)=( . . . ), [if C])  (2.3)

[0027] where Nb increases by 1 when this pattern is applied, C is a condition (the pattern can be applied only when this condition holds) and patterns stp(b)=( . . . ) are defined below. This property means: when aS recognizes an object or a situation as OSM then aS expects that OSM, with probability Nb/N, will change or support the changes of bef(aS,b,t) and des(aS,b,t) approximately as given by the pattern stp(b)=( . . . ), where N has the same meaning as above. In opposition to the stimulus patterns (2.1), patterns (2.3) are not used to compute the values bef(aS,b,t) and des(aS,b,t). Patterns (2.3) are used only to compute the stimulus of OSM. The patterns stp(b)=( . . . ) have the following simple forms:

eps(b)=(y,z)  i.

[0028] where −29≦y≦30, 0≦z≦60. When aS perceives OSM (and condition C holds) then aS expects that OSM, with probability Nb/N, will increase the value bef(aS,b,t) approximately to y and decrease the value des(aS,b, t) approximately to z.

ens(b)=(y,z)  ii.

[0029] where −30≦y≦29, 0≦z≦60. aS expects that OSM, with probability Nb/N, will decrease bef(aS,b,t) approximately to y and increase the value des(aS,b,t) approximately to z.

ups(b)=(p,OSM1.Ej)  iii.

[0030] where 0<p≦1 and in the model OSM1 is property Ej=(‘dr’,.,eps(b)=(y,z), . . . ). aS expects that OSM, with probability Nb/N, will support in degree p the positive changes of values bef(aS,b,t) and des(aS,b,t) according to the pattern in Ej.

uns(b)=(p,OSM1.Ej)  iv.

[0031] where 0<p≦1 and in the model OSM1 is property Ej=(‘dr’,.,ens(b)=(y,z), . . . ). aS expects that OSM, with probability Nb/N, will support in degree p the negative changes of values bef(aS,b,t) and des(aS,b,t) according to the pattern in Ej.

vps(b)=(p,OSM1.Ej)  v.

[0032] where 0<p≦1 and in the model OSM1 is property Ej=(‘dr’,.,eps(b)=(y,z), . . . ). aS expects that OSM, with probability Nb/N, will prevent in degree p the positive changes of values bef(aS,b,t) and des(aS,b,t) according to the pattern in Ej.

vns(b)=(p,OSM1.Ej)  vi.

[0033] where 0<p≦1 and in the model OSM1 is property Ej=(‘dr’,.,ens(b)=(y,z), . . . ). aS expects that OSM, with probability Nb/N, will prevent in degree p the negative changes of values bef(aS,b,t) and des(aS,b,t) according to the pattern in Ej.

[0034] Stimulus Intensity.

[0035] The expected (by aS, at time t) intensity of positive stimulus of pattern (2.1) is given by epr(aS,OSM,fsp,b,.,t) (defined in [AS5], Sect. 2.3.1), where fsp denotes the following (positive) pattern names: epb, upb, vnb, epbu, upbu. Let fsn denotes the following names of (negative) patterns: enb, unb, enbu, unbu, vpb, vnb. The expected (by aS, at time t) intensity of negative stimulus of pattern (2.1) (where fs=fsn) is given by enr(aS,OSM,fsn,b,.,t) (defined in [AS5], Sect. 2.3.2).

[0036] For the positive stimulus patterns eps, ups and vns, we define epr as follows: $\begin{matrix} {{{epr}\left( {{aS},{OSM},{eps},b,\quad \ldots \quad,t} \right)} = {\left( {{Nb}/N} \right)*{{des}\left( {{aS},b,t} \right)}*}} \\ {{{sqrt}\left( \left( {\left( {y - {{bef}\left( {{aS},b,t} \right)}} \right)^{2} +} \right. \right.}} \\ {\left. {{cr2}*\left( {{{des}\left( {{aS},b,t} \right)} - z} \right)} \right)*} \\ {\left. {{nq}(b)} \right),{{{if}\quad y} \geq {{bef}\left( {{aS},b,t} \right)}}} \\ {{{{and}\quad {{des}\left( {{aS},b,t} \right)}} \geq z}} \\ {{= 0},{otherwise}} \end{matrix}$

[0037] where cr2=0.4 and 0.5<nq(b)≦720 may be defined as follows: nq(GR(G))=270 (GR(G)—the need to belong to the community G), nq(NEw(OSM))=40 (NEw(OSM)—the need for curiosity and knowledge when perceiving an object or a situation OSM), nq(NEk(OSM))=50 (NEk(OSM)—the need for curiosity and knowledge of properties of OSM), nq(NEz(SM))=60 (NEz(SM)—the need of knowledge of how situation SM can be reached), nq(MA))=25 (MA—the need to have power over people and animals), nq(SE)=200 (SE—the need for sexual relations), nq(LI(OSA))=550 (LI(OSA)—the need for liking and love of aS to OSA, i.e. to object, situation or activity OSA), nq(AN)=570 (AN—the need for recognition, acknowledgment and self-esteem), nq(MB)=120 (MB—material and financial needs of aS), nq(BH(OK))=400 (BH(OK)—the need to help OK when OK needs help), nq(VR(PG))=10 (VR(PG)—the need for retaliation and revenge on PG), nq(WA(Pa))=240*ag(Pa) (WA(Pa)—the need to accomplish the commands and wishes of person or agent Pa), and 0≦ag(Pa)≦3 is the weight of authority of Pa over aS.

epr(aS,OSM,ups,b,.,t)=(Nb/N)*cb1*p*epr(aS,OSM1,eps,b,.,t)

[0038] where cb1=0.3 and eps(b)=( . . . ) is in OSM1.Ej.

epr(aS,OSM,vns,b,.,t)=(Nb/N)*p*enr(aS,OSM1,ens,b,.,t), where ens(b)=( . . . ) is in OSM1.Ej.

[0039] For the negative stimulus patterns ens, uns and vps, we define negative stimulus intensity enr as follows: $\begin{matrix} {{{enr}\left( {{aS},{OSM},{ens},b,\quad \ldots \quad,t} \right)} = {\left( {{Nb}/N} \right)*z*}} \\ {{{sqrt}\left( \left( {\left( {{{bef}\left( {{aS},b,t} \right)} - y} \right)^{2} +} \right. \right.}} \\ {\left. {\left. {{cr2}*\left( {z - {{des}\left( {{aS},b,t} \right)}} \right)} \right)*{{nq}(b)}} \right),} \\ {{{{if}\quad y} \leq {{{bef}\left( {{aS},b,t} \right)}\quad {and}}}} \\ {{{{des}\left( {{aS},b,t} \right)} \leq z}} \\ {{= 0},{{otherwise}.}} \end{matrix}$

enr(aS,OSM,uns,b,.,t)=(Nb/N)*cb1*p*enr(aS,OSM1,ens,b,.,t), where ens(b)=( . . . ) is in OSM1.Ej.

enr(aS,OSM,vps,b,.,t)=(Nb/N)*p*epr(aS,OSM1,eps,b,.,t), where eps(b)=( . . . )is in OSM1.Ej.

[0040] The intensity of positive stimulus of OSM (at time t) is given by

pros(aS,OSM,t)=Σ_(b∈Bp) epr(aS,OSM,fsp,b,.,t)

[0041] where Bp={b∈ WB | ( . . . fsp(aS,b)= . . . ) is in OSM}, fsp denotes a positive stimulus pattern (epb, upb, vnb, epbu, upbu, eps, ups, vns), WB={b∈ Bd(aS) | des(aS,b,t)>0.25* mdes(aS,t)} and mdes(aS,t)=max(des(aS,b,t), for b ∈ Bd(aS)).

[0042] The intensity of negative stimulus of OSM (at time t) is given by:

nros(aS,OSM,t)=Σ_(b∈Bn) enr(aS,OSM,fsn,b,.,t)

[0043] where Bn={b∈ WB | ( . . . fsn(aS,b)= . . . ) is in OSM} and fsn denotes a negative stimulus pattern (enb, unb, enbu, unbu, vpb, ens, uns, vps) The intensity of stimulus of OSM at time t (s. [AS5], Sect. 2.3.3):

rosa(aS,OSM,t)=pros(aS,OSM,t)−nros(aS,OSM,t)

[0044] Updating the Stimulus Patterns (2.3).

[0045] The following 4 rules are an example of how, on the basis of satisfactions, aS can learn which objects and situations (and in what degree) accomplish, support or prevent the satisfactions and desires of aS. Analogous rules can also be formulated for activities. Stimulus patterns (‘dr’,Nb, stp(b)=( . . . ) . . . ) in an object or situation model OSM can be updated as follows.

[0046] RN. When aS perceives an object or a situation as model OSM then: N :=N+1.

[0047] Rdr1. If object or situation OSM increased (decreased, respectively) bef(aS,b,.) or decreased (increased, respectively) des(aS,b,.) and in model OSM is property (‘dr’,Nb, eps(b)=(y,z) . . . ) ((‘dr’,Nb, ens(b)=(y,z) . . . ), respectively) then update this property as follows

Nb :=Nb+1; y :=y+0.5*(bef(aS,b,t)−y); z :=z+05*(des(aS,b,t)−z)

[0048]  where bef(aS,b,t), des(aS,b,t) are the values after the mentioned changes.

[0049] Rdr2. If: (i) object or situation OSM1 increased (decreased, respectively) bef(aS,b,.) or decreased (increased, respectively) des(aS,b,.) and in model OSM1 is property Ej=(‘dr’,.,eps(b)=(y,z).) (Ej=(‘dr’,.,ens(b)=(y,z) . . . ), respectively), (ii) object or situation OSM supported, in degree pa, the in (i) said changes of bef(aS,b,.) and des(aS,b,.), (iii) in model OSM is property (‘dr’,Nb, ups(b)=(p,OSM1.Ej) . . . ) ((‘dr’,Nb, uns(b)=(p,OSM1.Ej) . . . ), respectively), then update the property in OSM as follows

Nb :=Nb+1; p :=p+0.5*(pa−p).

[0050] Rdr3. If: (i) object or situation OSM1 does activity or is used to increase (to decrease, respectively) bef(aS,b,.) and in model OSM1 is property Ej=(‘dr’,.,eps(b)=(y,z) . . . ) (Ej=(‘dr’,.,ens(b)=(y,z) . . . ), respectively), (ii) object or situation OSM prevented, in degree pa. the in (i) said changes of bef(aS,b,.), (iii) in model OSM is property (‘dr’,Nb, vps(b)=(p,OSM1.Ej) . . . ) ((‘dr’,Nb, vns(b)=(p,OSM1.Ej) . . . ), respectively), then update the property in OSM as follows

Nb :=Nb+1; p :=p+0.5*(pa−p).

[0051] 2.2. Object and Situation Models

[0052] A simple object model of an object O is

M(O)=(‘s-ob’,VR(O); Ph1, . . . , Phm; wF1, . . . , wFu)

[0053] where: VR(O) is a visual representation (a visual pattern or scheme) of object O (if a visual representation of object O does not exist then VR(O)=nil);

[0054] Phe=(P(VOe), phre; where Cpe), where P(VOe) is the pointer to the part VOe of the visual representation VR(O)—this means that the phrase phre concerns the part VOe of the object O;

[0055] phre is a phrase or a phrase pattern (in abstract situation models) of a natural language, which is the designation of the object O; examples of (P(VOe), phre;.): (P(visual pattern of a salmon from Alaska), ‘salmon from Alaska’; . . . ), (P(visual pattern of a head of a salmon), ‘head of a salmon’; . . . ), (P(visual pattern of a fir), ‘fir’; . . . ), (P(visual pattern of a fir covered with snow), ‘fir covered with snow’; . . . ); Cpe is a condition for words in phre; the meaning of the phrases in Phe, e≦m, is the model M(O); an idea of the semantics of simple sentences, by object and situation models, is given in Schurmann [AS4];

[0056] wFi is a property of object O—it has one of the three forms:

[0057] (tf, idf, P(VOpi), Fi; if Cfi), (‘inst-of’, LP), (‘part-of’, LP) where: $\begin{matrix} {{{tf} = {‘{{ex}\text{-}{act}}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {list}\quad {of}\quad {{activities}/{operations}}}} \\ {{{{which}\quad {object}\quad O\quad {can}\quad {perform}},}} \\ {{= {{‘{{use}\text{-}{act}}’}\quad {if}\quad {Fi}\quad {is}\quad a\quad {list}\quad {of}\quad {{elements}\left( {{M({Obh})},{AOah}} \right)}}},} \\ {{{where}\quad {M({Obh})}\quad {is}\quad {an}\quad {object}\quad {model}\quad {and}\quad {AOah}}\quad} \\ {{{{denotes}\quad {an}\quad {activity}},{{{operation}\quad {or}\quad {action}};{{meaning}\text{:}}}}} \\ {{{when}\quad {object}\quad {M({Obh})}\quad {executes}\quad {AOah}\quad {then}\quad {it}}\quad} \\ {{{{can}\quad {use}\quad {object}\quad {M(O)}},}} \\ {{{tf} = {{‘{{act}\text{-}i\quad n}’}\quad {if}\quad {Fi}\quad {is}\quad a\quad {list}\quad {of}\quad {{elements}\left( {{M({Obh})},{AOah}} \right)}}};} \\ {{{meaning}\text{:}{object}\quad {M({Obh})}\quad {may}\quad {executes}\quad {activity}\quad {AOah}}} \\ {{{{in}\quad {object}\quad {M(O)}},}} \\ {{{= {‘{{act}\text{-}{rem}}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {list}\quad {of}\quad {activities}\quad {which}\quad {aS}}}\quad} \\ {{{can}\quad {execute}\quad {in}\quad {order}\quad {to}\quad {remove}\quad {or}\quad {to}\quad {avoid}}} \\ {{{{unwished}\quad {objects}\quad {or}\quad {situations}\quad {{from}/{in}}\quad {object}\quad {M(O)}},}} \\ {{= {‘{for}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {logical}\quad {formula}},} \\ {{{= {‘{fea}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {property}\quad {of}\quad {object}\quad {M(O)}},}\quad} \\ {{{tf} = {‘{res}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {result}\quad \left( {{only}\quad {if}\quad {wFi}\quad {occurs}\quad {in}\quad a}\quad \right.}} \\ {\left. {{situation}\quad {or}\quad {activity}\quad {model}} \right),} \\ {{= {‘{ds}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {stimulus}\quad {pattern}\text{:}{epb}},{upb},{vnb},} \\ {{{epbu},{upbu},{enb},{unb},{enbu},{unbu},{vpb},}\quad} \\ {{= {‘{dr}’}},{{if}\quad {Fi}\quad {is}\quad a\quad {stimulus}\quad {pattern}\text{:}{eps}},{ups},} \\ {{{vns},{ens},{uns},{{vps};}}} \\ {{{{idf} = {‘{id}’}},{{if}\quad {Fi}\quad {is}\quad {an}\quad {identifying}\quad {property}\quad {of}}}\quad} \\ {{{{object}\quad {M(O)}},{{{idf} = {{‘{nid}’}\quad {otherwise}}};}}} \end{matrix}$

[0058] P(VOpi) is the pointer to the part VOpi of the visual representation VR(O); this means that Fi concerns the part VOpi of the object M(O) (or situation SM, in situation model SM);

[0059] Cfi is a condition—Fi can be applied only when Cfi holds;

[0060] LP is a list of pointers to object or situation models;

[0061] (‘inst-of’, . . . , P(M(Og)), . . . ) means that object model M(O) is an instance of object model M(Og) (P(OSM) deno-tes the pointer to object or situation model OSM); we assume that if (‘inst-of’, . . . , P(M(Og)), . . . ) occurs in M(O), then M(O) has all properties that occur in M(Og); consequently, in M(O) must be given only the properties characteristic for object O; example: if O denotes Mrs. Gleen who is a nurse, married and mother of a child, then in the model M(Mrs. Gleen) should be the property (‘inst-of’, P(nurse), P(married woman), P(mother), . . . );

[0062] (‘part-of’, . . . , P(OSM), . . . ) means that object M(O) is a component of object or situation model OSM (if OSM is an object model, then it is a structured object model).

[0063] Structured object model. If M(O1), . . . , M(On) are simple or structured object models and object Q consists of objects O1, . . . , On then

M(Q)=(‘str-ob’, VR(Q); Ph1, . . . , Phm; wF1, . . . , wFr; (pr(O1), P(VR(O1)), M(O1), . . . , (pr(On), P(VR(On)), M(On)); LOS(Q))  (2.4)

[0064] is a structured object model (of the object Q), where: VR(Q), Phe, wFi are defined above, the model M(Q) is the semantic meaning of the phrases in Phe;

[0065] pr(Oi) is the probability that object M(Oi) appears/occurs in object M(Q);

[0066] P(VR(Oi)) is the pointer to the location of object M(Oi) in VR(Q) (if the location of M(Oi) is not known or not defined then P(VR(Oi))=nil);

[0067] LOS(Q) is the list of objects and situations which can appear in object Q; LOS(Q) may e.g. have the form:

((pr(Oa1), M(Oa1)), . . . , (pr(Oav), M(Oav)); (pr(Ss1), SMs1), . . . , (pr(Ssq), SMsq); SFQ1, . . . , SFQp)

[0068]  where: (pr(Oai), M(Oai)) ((pr(Sse), SMse), respectively) means: object M(Oai) (situation SMse, respectively) appears in object Q with probability pr(Oai) (pr(Sse), respectively);

[0069] SFQe is a situation sequence (Je, SMe1, . . . , SMeu), where the index Je points to the situation SM_(je) which last appeared in this sequence; it holds: after situation SMej must appear situation SMe(i+1); SFQe can be a timetable showing the days or hours at which situations SM_(Je) appear in Q (aS can perform some activities according to the timetable).

[0070] By stimulus patterns, aS distinguishes the wished situations (with rosa(aS,SMsi,t) >5) from the unwished ones (with rosa(aS,SMsi,t) <4) in M(Q). It holds

rosa(aS,M(Q),t)=rosa(aS,St-p,t), where St-p={sp | sp is a stimulus pattern in wFe, e=1, . . . , r}.

[0071] An object model is a simple or a structured object model. We assume that there is a function procedure IdO(O1,M(O)) which determines how good model M(O) represents object O1.

[0072] Situation model. If M(O1), . . . , M(On) are object models then

SM =(‘s-sit’, Sch; Ph1, . . . , Phq; wF1, . . . , wFp; (pr(O1), dm(O1), P(VR(O1)), M(O1)), . . . ,

(pr(On),dm(On), P(VR(On)), M(On)))

[0073] is a simple situation model, where:

[0074] Sch is a visual representation of the structure of situation SM; if SM is a visual situation then Sch can be a 3 dimensional space which aS sees from point (0,0,0); Sch can be a scheme showing how the situation model is composed of models M(O1), . . . , M(On) and the possible motions of these objects in the situation SM;

[0075] Phi has analogous form and meaning as in the definition of object model; the meaning of a phrase or a pattern of a phrase, contained in Phi, is the model SM; example: ‘Mr. and Mrs. Marlow are eating at the table in the dining room’;

[0076] wFe is a property of the situation SM—it has the same form as in the definition of object model;

[0077] pr(Oi) is the probability that object M(Oi) appears in situation SM;

[0078] dm(Oi) shows motion directions of object M(Oi) in Sch;

[0079] P(VR(Oi)) and M(Oi) have analogous meaning as in the definition of structured object.

[0080] It holds: rosa(aS,SM,t)=rosa(aS,St-ps,t), where St-ps={sp | sp is a stimulus pattern in wFe, e≦p}.

[0081] To represent more complex situations, I introduce meta-situations. If M(O1), . . . , M(On) are object models and SM1, . . . , SMw are simple situation models, then

mSM =(‘m-sit’, vsch; Ph1, . . . , Phq; wF1, . . . , wFu; SM1, . . . , SMw; (pr(O1), dm(O1), P(VR(O1)),M(O1)), . . . , (pr(On),dm(On), P(VR(On)), M(On)))

[0082] is a meta-situation model, where:

[0083] vSch is a scheme which shows visually the structure of the meta-situation, e.g. locations where M(Oi) and SMe occur in mSM;

[0084] Phe, wFj, (pr(Oi), dm(Oi), P(VR(Oi)), M(Oi)) have analogous meaning as in the definition of situation model.

[0085] In special cases (when mSM has been identified), mSM can contain also meta-situations—these meta-situations do not occur in object models. Remark: property of the form (‘fea ’, ‘id’,., SMe), in meta-situation model mSM, means: meta-situation mSM appears only then when situation SMe is appeared. It holds

rosa(aS,mSM,t)=rosa(aS,St-pm,t), where St-pm={sp| sp is a stimulus pattern in wFe, e≦w}.

[0086] In this patent description, situation (situation model) means a simple situation (simple situation model, respectively) or a meta-situation (meta-situation model, respectively). We assume that a procedure IdS(S,SM) (IdmS(mS,mSM), respectively) determines how good simple situation model SM (meta-situation model mSM, respectively) represents simple situation S (meta-situation mS, respectively). By ‘object M(O) (situation SM, respectively)’ we understand an object (a situation, respectively) which is represented by model M(O) (SM, respectively).

[0087] Because of recognition of objects and situations, object and situation models must constitute a directed graph, SeG (called in this paper semantic graph; SeG is a component of aS), which shows the abstraction levels of object and situation models (graph SeG defined the author in [AS4]). SeG, thus the object and situation models, must be so defined that:

[0088] i. a node, K, is an object or situation model,

[0089] ii. node Kj is a successor of node K if and only if (‘inst-of’, . . . , P(K), . . . ) occurs in the model Kj,

[0090] iii. SeG has 3 root nodes M(object), SM(simp-sit), mSM(meta-sit) such that: (a) from the node M(object) exists a path to each object node, (b) from the node SM(simp-sit) exists a path to each simple situation node, (c) from the node mSM(meta-sit) exists a path to each meta-situation node,

[0091] iv. if there is a path from node Ki to node Kj then there is no path from Kj to Ki.

[0092] By the graph SeG and the phrases in object and situation models can be described the syntax and semantics of simple natural languages, as shown in [AS4].

[0093] 2.3. Activity Model

[0094] The author defined behavior scheme in [AS3] (1998)—however such schemes are not sufficient to represent activities of the system aS.

[0095] An activity model (or activity scheme, in short: activity) has the following form

[0096] actvity AV(P1, . . . , Pn), ta, tv, Pβ1, . . . , Pβμ; reso (rs1: r1), . . . , (rsk: rk); Mst-p;

[0097] inits (ifb SMa1: (pz1(SMz1), SMz1), . . . , (pz1(SMzh), SMzh); (pu1(SMu1), SMu1), . . . , (pu1(SMur),SMur)), . . . , (ifb SMaq: (pzq(SMz1), SMz1), . . . , (pzq(SMzh), SMzh); (puq(SMu1), SMu1), . . . , (puq(SMur),SMur));

[0098] goals SMz1, . . . , SMzh; begin (V, SB) endact

[0099] where: P1, . . . , Pn denote parameters used when activity AV is executed;

[0100] ta—period of time needed for execution of activity AV,

[0101] tv—period of time which aS personally needs (i.e. its processor PrA) for execution of the activity; ta, tv and (rsj: rj) can depend on parameters P1, . . . , Pn;

[0102] Pβe=(phrβe; where Cβe), where phrβe is a phrase (e.g. a simple sentence) of a natural language, which designates the activity AV—the activity AV is the meaning of the phrase phrβe;

[0103] rsj: rj—resources (means, objects) which aS needs for execution of the activity AV—rsj denotes the needed object and rj the needed quantity of rsj;

[0104] Mst-p—set of stimulus patterns describing the expected stimuli which arise when the activity AV is being executed;

[0105] SMai—initial situations of the activity AV—in these situations aS may begin the execution;

[0106] Because of recognition of objects and situations, object and situation models must constitute a directed graph, SeG (called in this paper semantic graph; SeG is a component of aS), which shows the abstraction levels of object and situation models (graph SeG defined the author in [AS4]). SeG, thus the object and situation models, must be so defined that:

[0107] i. a node, K, is an object or situation model,

[0108] ii. node Kj is a successor of node K if and only if (‘inst-of’, . . . , P(K), . . . ) occurs in the model Kj,

[0109] iii. SeG has 3 root nodes M(object), SM(simp-sit), mSM(meta-sit) such that: (a) from the node M(object) exists a path to each object node, (b) from the node SM(simp-sit) exists a path to each simple situation node, (c) from the node mSM(meta-sit) exists a path to each meta-situation node,

[0110] iv. if there is a path from node Ki to node Kj then there is no path from Kj to Ki.

[0111] By the graph SeG and the phrases in object and situation models can be described the syntax and semantics of simple natural languages, as shown in [AS4].

[0112] 2.3. Activity Model

[0113] The author defined behavior scheme in [AS3] (1998)—however such schemes are not sufficient to represent activities of the system aS.

[0114] An activity model (or activity scheme, in short: activity) has the following form

[0115] activity AV(P1, . . . , Pn), ta, tv, Pβ1, . . . , Pβμ; reso (rs1: r1), . . . , (rsk: rk); Mst-p;

[0116] inits (ifb SMa1: (pz1(SMz1), SMz1), . . . , (pz1(SMzh), SMzh); (pu1(SMu1), SMu1), . . . , (pu1(SMur),SMur)), . . . , (ifb SMaq: (pzq(SMz1), SMz1), . . . , (pzq(SMzh), SMzh); (puq(SMu1), SMu1), . . . , (puq(SMur),SMur));

[0117] goals SMz1, . . . , SMzh; begin (V, SB) endact

[0118] where: P1, . . . , Pn denote parameters used when activity AV is executed;

[0119] ta—period of time needed for execution of activity AV,

[0120] tv—period of time which aS personally needs (i.e. its processor PrA) for execution of the activity; ta, tv and (rsj: rj) can depend on parameters P1, . . . , Pn;

[0121] Pβe=(phrβe; where Cβe), where phrβe is a phrase (e.g. a simple sentence) of a natural language, which designates the activity AV—the activity AV is the meaning of the phrase phrβe;

[0122] rsj: rj—resources (means, objects) which aS needs for execution of the activity AV—rsj denotes the needed object and rj the needed quantity of rsj;

[0123] Mst-p—set of stimulus patterns describing the expected stimuli which arise when the activity AV is being executed;

[0124] SMai—initial situations of the activity AV—in these situations aS may begin the execution;

[0125] SMze—goal situations of the activity AV—activity AV is executed in order to reach a goal situation; SMzi is a final node of the graph (V, SB);

[0126] SMui—a final node of the graph (V, SB) but not goal situation—not wished situation which can be reached when the activity is executed;

[0127] pzi(SMze) (pui(SMue), respectively)—the probability that the goal situation SMze (situation SMue, respectively) will be reached when the execution of the activity begins at the initial situation SMai;

[0128] (V, SB)—a connected graph the nodes (in V) of which are situation models, and to each arc (SMi, SMj) is ascribed a sub-activity, su-act(SMi,SMj) ∈ SB.

[0129] Sub-activity su-act(SM,SMj) (in activity AV) determines the elementary activities, operations and actions which should be executed to reach the situation SMj, when the execution of the activity AV reached the situation SM. Sub-activity su-act(SM,SMj) has one of the two forms:

[0130] (sa1) (aS, LPj; (ta1j, ta2j), reso (roj1: nj1), . . . , (roja: nja); wj, (wsj, SMj), (wsj1, SMj1), . . . , (wsjv, SMjv); (OAj1; . . . ; OAjm)), when aS himself (i.e. its processor PrA) does this sub-activity,

[0131] (sa2) (Mcaj, LPj; (ta1j, ta2j), reso (roj1: nj1), . . . , (roja: nja); contr-su-actj, wj, (wsj, SMj), (wsj1, SMj1), . . . , (wsjv, SMjv); (Aj1; . . . ; Ajm)), when Mcaj does this sub-activity and aS controls only the execution,

[0132] where: LPj=(pszj(SMz1), . . . , pszj(SMzh); psuj(SMu1), . . . , psuj(SMu1), . . . , psuj(SMur) is the list which determines the priority of this sub-activity, where pszj(SMz1), (or psuj(SMue)) is the probability of reaching the goal situation SMzi (the situation SMue, respectively) when su-act(SM,SMj) will be executed; it holds pszj(SMz1)+ . . . +pszj(SMzh)+psuj(SMu1)+ . . . +psuj(SMur)=1;

[0133] ta1j, ta2j is the minimal and maximal time period needed for execution of this sub-activity;

[0134] roji, nji—resources needed for execution of the sub-activity; nji denotes the needed quantity of object roji;

[0135] wj, wsj, wsji are weights—wj increases if this sub-activity is executed, wsj (wsji, respectively) increases if the execution of this sub-activity led to situation SMj (SMji, respectively);

[0136] SMj, SMj1, . . . , SMjv are successors of the node SM in the graph (V, SB); they are the expected situations which can be reached when this sub-activity is executed;

[0137] OAje is an elementary activity which has one of the following forms:

[0138] a) OAje is an elementary activity or action which does not begin with If or while; OAje can depend on parameters; OAje is mainly a motion activity which aS should perform;

[0139] b) if Ce then begin OAk1; . . . ; OAkd end else begin OAf1; . . . ; OAFw end

[0140] c) while Ce do begin OAk1; . . . ; OAkw end

[0141] where Ce, in (b) and (c), is a condition, and OAki, OAfs are activities of the form (a);

[0142] Mcaj denotes a processor, robot, agent, machine or an other system which does the sub-activity (sa2); aS controls this execution by the control-activity contr-su-actj;

[0143] contr-su-actj denotes the following simple control-activity

[0144] contr ctj, atj, grj do OApj1; . . . ; OApjb thenc observ(tatj,FOSj,t); CAj1; . . . ; CAJd endc

[0145] where: aS should control the execution of sub-activity (sa2) after each time period ctj,

[0146] atj is the time period of execution of the sub-activity by Mcaj after the last control,

[0147] 0 <grj≦2 is a degree of importance of controlling the execution of the sub-activity,

[0148] OApje are elementary activities which aS does to control the execution of the sub-activity,

[0149] observ(tatj,FOSj,t) observes, at least tatj time period, objects and situations given in FOSj=M(Oxj1), . . . , M(Oxjg); SM1xj1, . . . , SM1xjs, where M(Oxji) and SM1xje are (expected) objects and situations which can appear when the sub-activity is being executed; these objects and situations observ(tatj,FOSj,t) observes with intensities des(aS,AUw(M(Oxji)),t), i≦g, and des(aS,AUw(SM1xje),t), e≦s;

[0150] CAje, e≦d, are control activities of the form

[0151] ifs sitExpje then begin OAxje1; . . . ; OAxjef end

[0152] sitExpje is a situation expression of the form:

[0153] i) situations SMxje, e≦d1, are situation expressions, where SMxje are expected between-situations which can appear when the sub-activity (sa2) is being executed;

[0154] ii) when SMEx1 and SMEx2 are situation expressions then

[0155] (SMEx1), not (SMEx1), SMEx1 or SMEx2, SMEx1 and SMEx2

[0156]  are situation expressions—they have the following meaning: SMxje, (SMxje)—situation SMxje is appeared, situation not (SMEx1) is appeared when situation SMEx1 is not appeared, situation SMEx1 or SMEx2 is appeared when situation SMEx1 or SMEx2 is appeared, situation SMEx1 and SMEx2 is appeared when situations SMEx1 and SMEx2 are appeared;

[0157] OAxje, e=1, . . . , f, are elementary activities which aS executes when situation sitExpje has appeared.

[0158] The Execution of Sub-Activity.

[0159] aS does himself the sub-activity (sa1) (i.e. the (motion) activities OAj1, . . . ; OAjm) to reach the situation SMj (with probability (approximately) wsj/ wj) from the situation SM. However, instead of SMj, aS can reach situation SMje (e≦v), with probability (approximately) wsje/wj. When a situation SMj, SMje, e≦v, appears, then the execution of the sub-activity (sa1) (or (sa2)) is finished. The execution of sub-activity (sa1) or (sa2) is wrong and should be abandoned if the sub-activity is executed longer than ta2j.

[0160] Sub-activity (sa2) does Mcaj to reach situation SMj, with probability (approximately) wsj/ wj; however, Mcaj (and aS) can reach (with probability (approximately) wsje/wj) situation SMje, e≦v. Activities Aj1, . . . , Ajm are done by Mcaj. When Mcaj is doing sub-activity (sa2), then some situations SMxji, i≦d1, should appear until one of the situations SMj, SMje, e≦v, appears. After every time period ctj, or earlier, aS should control the execution of the sub-activity by contr-su-actj: firstly, it executes the elementary motion activities OApj1; . . . ; OApjb, after that, the observing activity observ(tatj,M(Oxj1), . . . , M(Oxjg); SM1j1, . . . , SM1xjs;t) at least tatj long; after the time period tatj, aS does the first activity CAje for which holds: ‘situation sitExpje is appeared’—i.e. when sitExpje is appeared then aS does the elementary activities OAxje1; . . . ; OAxjef (which are in CAje). In this way, aS may correct or abandon the execution of the sub-activity if sitExpje represents an unwished situation. When Mcaj begins the execution of the sub-activity then: at :=0. After aS controlled this execution then: at :=0. aS is motivated to do the control-activity contr-su-actj in (sa2). The intensity of this motivation equals

mot-cont(AV,SM,SMj,atj,t)=(atj/ctj)*grj*motsu-act(SM,SMj,t)

[0161] where atj is the duration of execution of the sub-activity (sa2) (without interruptions) after the last control by contr-su-actj, and motsu-act(SM,SMj,t) is the motivation of aS to execute the sub-activity (sa2) (this motivation is defined in Sect. 3.2).

[0162] 3. The Motivation to Execute an Activity or a Command

[0163] According to the method DKA, the execution of an activity or a command is determined by the motivation of aS. This motivation is determined by several kinds of motivations as follows.

[0164] 3.1. The Motivation to Execute an Activity

[0165] We use the notation applied in the definition of activity.

[0166] The reacting motivation of aS (at time t) to execute an activity AV, starting at initial situation SMai, equals

reamota(aS,SMai,AV,t)=rosa(aS,Mst-p,t)+pzi(SMz1)*rosa(aS,SMz1,t)+ . . . +pzi(SMzh)*rosa(aS,SMzh,t)+pui(SMu1)*rosa(aS,SMu1,t)+ . . . +pui(SMur)*rosa(aS,SMur,t)

[0167] In normal circumstances should be rosa(aS,SMze,t)>0, for e≦h, and rosa(aS,SMue,t)<0, for e≦r.

[0168] Reflective motivation. aS may have calculated the expected satisfactions, bef(aS,b,t+e*g), and desires, des(aS,b,t+e*g), for e=1, . . . , e_(b), (e.g. by stimulus patterns, as shown in [AS5]), for some needs b, where g denotes a number of hours, days or weeks. If e.g. bef(aS,b,t1)<−5 and des(aS,b,t1)>12, for t+e1*g<t1<t+e2*g, and aS has an activity AV1 which will increase bef(aS,b,t1) and decrease des(aS,b,t1) when aS executes AV1 in the time (t, t1), then aS is motivated to execute this activity. In this case, the motivation is arisen by reflection on the future intensities of satisfactions and desires.

[0169] The motivation of aS (at time t) to execute activity AV, from initial situation SMai, in order to increase satisfactions in the future, at time t1, equals

reflmota(aS,SMai,AV,t,t1)=rosa(aS,Mst-p,t)+pzi(SMz1)*rosa(aS,SMzl,t1)+ . . . +pzi(SMzh)*rosa(aS,SMzh,t1)+pui(SMu1)*rosa(aS,SMu1,t1)+ . . . +pui(SMur)*rosa(aS,SMur,t1)

[0170] where t1>t+ta (ta is the time period needed for execution of AV).

[0171] Compelled motivation. aS may be in an initial situation SMai of an activity AV such that if aS does not execute the activity AV then aS will get, after a time period zt, with probability pg, into an unwished situation SMd such that rosa(aS,SMd,t1)<−4, for t1≧t. If however aS executes activity AV and reaches a goal situation of this activity, then aS will not get into the situation SMd. These relation we denote by

[0172] (3.1) compst(aS,SMai,AV,zt,pg,SMd)

[0173] Thus, if the relation (3.1) holds, then aS is motivated to do the activity AV in order not to get into the unwished Situation SMd. The relation (3.1) is connected with SMai and AV by the following set AK(SMai):

[0174] i. if SMai is an initial situation of an activity AVthen AV belongs to AK(SMai),

[0175] ii. if activity AV belongs to AK(SMai) and (3.1) holds for SMai and AV, then compst(aS,SMai,AV,zt,pg,SMd) belongs to AK(SMai).

[0176] Compelled reacting motivation. If compst(aS,SMai,AV,zt,pg,SMd) is in AK(SMai), where zt≦1 min, then the compelled reacting motivation (at time t) to do the activity AV equals:

copreamota(aS,SMai,AV,pg,SMd,t)=reamota(aS,SMai,AV,t)−pg*rosa(aS,SMd,t).

[0177] Compelled reflective motivation. If reflmota(aS,SMai,AV,t,t1) is defined, where t1>t+ta>t+1 min, and compst(aS,SMai,AV,t1−t,pg,SMd) is in AK(SMai), then the compelled reflective motivation (at time t) to do the activity AV equals:

coprefmota(aS,SMai,AV,pg,SMd,t,t1)=reflmota(aS,SMai,AV,t,t1)−pg*rosa(aS,SMd,t1).

[0178] The motivation to execute activity. The above described motivations are used to determine the motivation of aS (at time t) to execute activity AV, from initial situation SMa, in the following way. To simplify the description of the procedure below, we assume that for SMa and activity AV is only one relation (3.1) in AK(SMa).

[0179] procedure mot(aS,SMa,AV,t, res motak,pg,SMg,t2,art,zy1);

[0180] bgs zv1:=0.2 min; pg:=0; SMg:=nil; t2:=t+0.9 min;

[0181] if compst(aS,SMa,AVyzt,pd,SMd) is in AK(SMa) and zt<1 min then begin art :=‘coprea’; pg :=pd;

motak :=copreamota(aS,SMa,AV,pd,SMd,t); SMg :=SMd; t2:=t+zt end else

[0182] begin motak :=reamota(aS,SMa,AV,t); art :=‘rea’ end;

[0183] let t1>t+ta>t+1 min, where ta denotes the time period needed for execution of the activity AV;

[0184] Bz(AV):={b| need b occurs in a stimulus pattern occurring in a goal situation SMze (e≦h) or in an unwished situation SMui (i≦r) of the activity AV};

[0185] if cognitive procedures of aS can determine intensities of satisfactions bef(aS,b,t1) and desires des(aS,b,t1), for b ∈Bz(AV) then begin

[0186] if compst(aS,SMa,AV,t1−t,pd,SMd) is in AK(SMa) and rosa(aS,SMd,t1) can be computed then

[0187] begin if coprefmota(aS,SMa,AV,pd,SMd,t,t1)>motak then begin art :=‘copref’; zy1;=t1−t−ta;

motak:=coprefmota(aS,SMa,AV,pd,SMd,t,t1); pg:=pd; SMg :=SMd; t2:=t1 end end else

[0188] begin if reflmota(aS,SMa,AV,t,t1)>motak then begin art :=‘refl’; zy1;=t1−t−ta; t2:=t1;

motak:=reflmota(aS,SMa,AV,t,t1) end end end end mot.

[0189] The result motak of the procedure is the motivation of aS to execute activity AV, from initial situation SMa. The priority of execution of activity AV (at time t), from initial situation SMa, can be determined as follows (if the time is given in hours)

prior-a(SMa,AV,t)=motak*4.5/sqrt(zv+16), if zv>−0.02 h (=1.2 min)

[0190] where motak and zv are determined by mot(aS,SMa,AV,t,motak,pg,SMg,t2,art,zv) (zv is the reserve time which aS has, for execution of the activity AV).

[0191] 3.2. The Motivation to Execute Sub-Activity

[0192] We use the notation introduced in the definition of sub-activity su-act(SM,SMj) in Sect. 2.3. Let the execution of the activity AV began, at time to, in initial situation SMai and reached, at time t, the situation SM. The operation mot(aS,SMai,AV,to,motak,pg,SMg,t2,art,zv) has been executed. The motivation, at time t>to, to execute subactivity su-act(SM,SMj) equals $\begin{matrix} {{{{motsu}\text{-}{{act}\left( {{AV},{SM},{SMj},t} \right)}} = {morea}},{{{if}\quad {art}} = {‘{rea}’}}} \\ {{= {{morea}\text{-}{pg}*{rosa}\quad \left( {{aS},{SMg},t} \right)}},{{if}\quad {art}}} \\ {= {‘{coprea}’}} \\ {{= {morefl}},{{{if}\quad {art}} = {‘{refl}’}}} \\ {{= {{morefl}\text{-}{pg}*{rosa}\quad \left( {{aS},{SMg},{t2}} \right)}},{{if}\quad {art}}} \\ {= {‘{copref}’}} \end{matrix}$

[0193] where pg, SMg, art and t2 are determined by the above mentioned operation mot and

morea=pzj(SMz1)*rosa(aS,SMz1,t)+ . . . +pzj(SMzh)*rosa(aS,SMzh,t)+puj(SMu1)*rosa(aS,SMu1,t)+ . . . +puj(SMur)*rosa(aS,SMur,t),

merefl=pzj(SMz1)*rosa(aS,SMz1,t2)+ . . . +pzj(SMzh)*rosa(aS,SMzh,t2)+puj(SMu1)*rosa(aS,SMu1,t2)+ . . . +puj(SMur)*rosa(aS,SMur,t2).

[0194] When activity AV is performing a command received from Pa, then additionally the operation is executed: motsu-act(AV,SM,SMj,t):=motsu-act(AV,SM,SMj,t)+epr(aS,M(Pa),eps,WA(Pa),.,t)+epr(aS,M(Pa),eps,AN,.,t)

[0195] 3.3. The Motivation to Perform Command

[0196] aS can receive a command/order, BOf, to execute, interrupt or abandon an activity, from an authorized person or an other emotional system, Pa. For each Pa, authorized to give orders, aS has weight, ag(Pa), of the authority of Pa over aS. We assume that 0≦ag(Pa)≦3; the greater ag(Pa) the greater is the authority of Pa over aS. When P1a has given aS a command/order BOf, then are applied the following rules.

[0197] RPal. If ag(Pa)>ag(P1a), then Pa can abandon the execution of the command BOf or command aS to continue the execution of the abandoned execution of the order BOf.

[0198] RPa2. If ag(Pa)≦ag(P1a), then Pa is not authorized: (a) to abandon the execution of the command BOf, (b) to command aS to continue the execution of the abandoned execution of BOf.

[0199] An order BOf must contain the following information: wg(BOf)—how important is the order BOf, zt(BOf)—the time period in which the execution of the order BOf should start. We may interpret wg(BOf) as follows: wg(BOt)=0.5 if BOf is of little importance to Pa, wg(BOf)=1.3 if BOf is of not much importance to Pa, wg(BOf)=2.2 if BOf is important to Pa, wg(BOf)=3.0 if BOf is of great importance to Pa, wg(BOf)=3.8 if BOf is of extreme importance to Pa.

[0200] For authorized Pa, aS must have the following needs: WA(Pa)—the need to fulfil the orders and wishes of Pa, AN—the need for recognition, acknowledgment and self-esteem. To make sure that aS has always the desire to satisfy the mentioned needs, the following rules are applied:

[0201] RWAN1. Every na hours aS does the following operations (for each authorized Pa):

[0202] if bef(aS,AN,t)≦−9 then bef(aS,AN,t):=max(bef(aS,AN,t)−0,6*ag(Pa), −3.3*ag(Pa));

[0203] des(aS,AN,t):=min(des(aS,AN,t)+1.2* ag(Pa), 18*ag(Pa));

[0204] if bef(aS,WA(Pa),t)≦−10 then bef(aS,WA(Pa),t):=max(bef(aS,WA(Pa),t)−0,6*ag(Pa), −3.5*ag(Pa));

[0205] des(aS,WA(Pa),t):=min(des(aS,WA(Pa),t)+1.2* ag(Pa), 18*ag(Pa)).

[0206] RWAN2. When aS receives a command, BOf, from authorized Pa (at time t) then:

[0207] des(aS,WA(Pa),t):=min(des(aS,WA(Pa),t)+1.1*(wg(BOf)+2.5*ag(Pa)), 18*ag(Pa));

[0208] des(aS,AN,t):=min(des(aS,AN,t)+1.1*(wg(BOf)+2.5*ag(Pa)), 18*ag(Pa)).

[0209] RWAN3. When aS accomplished (at time t) a command, BOf, received from Pa, then:

[0210] bef(aS,WA(Pa),t):=min(bef(aS,WA(Pa),t)+wg(BOf)+2.5* ag(Pa), 8.5*ag(Pa));

[0211] des(aS,WA(Pa),t):=max(des(aS,WA(Pa),t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa));

[0212] bef(aS,AN,t):=min(bef(aS,AN,t)+(wg(BOf)+2.5*ag(Pa)), 8.5*ag(Pa));

[0213] des(aS,AN,t):=max(des(aS,AN,t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa)).

[0214] The motivation (at time t) of aS to perform a command BOf, received (at time to) from authorized Pa, is determined as follows:

[0215] i. t2:=to+zt(BOt); apply the rule RWAN2;

[0216] ii. determine the activity, AVf, which will accomplish the order BOf, and initial situation, SMfae, of this activity;

[0217] iii. mot(aS,SMfae,AVf,t,motak,pg,SMg,t3,art,zv); the motivation to perform command BOf equals mot-ord(aS,BOf,AVf,SMfae,Pa,t)=motak+epr(aS,M(Pa),eps,WA(Pa),.,t)+epr(aS,M(Pa),eps,AN,t); the motivation to execute the activity AVf equals mot-ord(aS,BOf,AVf,SMfae,Pa,t);

[0218] iv. the priority of performing the order BOf (at time t) and the activity AV: prior-ord(BOf,AVf,SMfae,Pa,t)=mot-ord(aS,BOf,AVf,SMfae,Pa,t)*4.5/sqrt(t2−t+16), prior-a(SMfae,AVf,t)=priorord(BOf,AVf,SMfae,Pa,t).

[0219] 4. General Specification of the Subsystem WP of aS

[0220] WP identifies objects and simple situations by object and situation models which are in the semantic graph SeG (s. Sect. 2.2). If there is a path (in this graph) from an object model M(Og) (situation model SMg) to an object model M(O) (situation model SM, respectively), then M(O) (SM, respectively) is an instance of the model M(Og) (SMg, respectively). Model M(Og) (SMg, respectively) is a class of object models (situation models, respectively) to which M(O) (SM, respectively) belongs. Below, clo(M(O)) (cls(SM), respectively) denotes an object model (situation model, respectively), in graph SeG, such that from this model clo(M(O)) (cis(SM), respectively) exists a path to the model M(O) (SM, respectively). Because WP is very closely connected with the method DKA, some important properties of WP must be given.

[0221] SPW1. WP perceives the surrounding of aS through sensors, identifies objects and simple situations (not meta-situations) as instantiated object and simple situation models, and stores them in AW(t). Also sentences of a simple language are identified syntactically and semantically by WP and stored in AW(t). AW(t) is the internal representation of the actual world of aS at time t. The main part of AW(t) is a tree TOS such that:

[0222] i. To each node of the tree is ascribed an object which aS has perceived. KTOS(Wa) is the root of the tree, where M(Wa) is the model of the greatest spatial object in the world of aS. aS (“self”) is always in a structured object in TOS.

[0223] ii. KTOS(Qi) is a successor of a node KTOS(Q) if and only if Q is a structured object which has appeared, and WP has recognized that object Qi has appeared direct in object Q.

[0224] iii. Each node KTOS(Q) has the following form

(P(V),sK(Q),Q,M(Q),apOS(Q),amS(Q),nOS(Q),fOS(Q),nfOS(Q),fmS(Q),dOS(Q),LOSa(Q),LbOa(Q))

[0225] where: P(V)—the pointer to the father of the node KTOS(Q),

[0226] sK(Q)—the list of pointers to the successors of the node KTOS(Q),

[0227] M(Q)—WP has identified object Q as M(Q),

[0228] apOS(Q)—the list of objects and simple situations which actually appear in object Q (not foreseen objects and situations are marked with ‘nexp’),

[0229] amS(Q)—the list of meta-situations which actually appear in structured object Q (not foreseen meta-situation is marked with ‘nexp’),

[0230] nOS(Q)—the list of objects and simple situations in object Q, which just have been recognized ; elements of the lists apOS(Q) and nOS(Q) have the form:

(P(VR(O1i)),O1i,M(Oi),ti,IdO(O1i,M(Oi)),ox) or (P(VR(S1e)),S1e,SMe,ti,IdS(S1e,SMe),ox)

[0231]  where object O1i (situation S1e, respectively) has been identified by IdO (IdS, respectively) as M(Oi) (SMe, respectively) (at time ti); P(VRO1i)) (P(VR(S1e))) is pointer to the location of the object O1i (the situation S1e, respectively) in VR(Q); O1i (S1e) is an instantiation of the model M(Oi) (SMe, respectively); ox=‘exp’ if M(Oi) (SMe, respectively) is declared (expected/foreseen) in object M(Q), ox=‘nexp’ otherwise;

[0232] fOS(Q)=(Q,M(Q), ob (pr(Of1),M(Of1)), . . . , (pr(Of a),M(Of a)); sit (pr(Sf1),SMf1), . . . , (pr(Sfw),SMfw))—the list of missed/absent objects and simple situations in object Q; WP enters these objects and situations in the list when: (a) it has recognized object Q as M(Q) and recognizes now that object M(Ofi) or simple situation SMfe is not in object Q. although it should be with probability pr(Ofi) (pr(sfe), respectively) in Q, (b) it recognizes that object M(Ofj) or simple situation SMfg is disappeared from object Q, although it should be in Q until now, with the given probability;

[0233] nfOS(Q)—the list of objects and simple situations, just having been recognized as missed/absent in object Q,

[0234] fmS(Q)—the list of missed/absent meta-situations in object Q,

[0235] dOS(Q)=(Q,M(Q), ob (O1d1,M(Od1)), . . . , (O1da,M(Oda)); sit (S1d1,SMd1), . . . , (S1dw,SMdw))—the list of objects and simple situations which have disappeared from object Q; WP has recognized that object O1di, identified as M(Odi), or situation S1de, identified as SMde, was in object Q and now is not in Q;

[0236] LOSa(Q)—the list of objects and situations which are connected with execution of activities (by some objects Masi) in object Q; an element of this list has the form:

[0237] EOSa(Mas)=(Mas,P(exOSa(AVh,su-akh)),P(apOSa(AVh,su-akh)),nOSa(AVhysu-akh),dOSa(AVh,su-akh)) where: object Mas performs activity AVh in object Q, (i.e. the current sub-activity su-akh of AVh is being executed or is waiting for execution); the method DKA enters element EOSa(Mas) in the list, when it determines that Mas has to do the sub-activity su-akh;

[0238] P(L(Avh,.))—pointer to the list L(AVh,.) in ZuA(AVh) (ZuA(AVh) is the state of execution of the activity AVh described in Sect. 5.1),

[0239] exOSa(AVh,su-akh)—the list (in ZuA(AVh)) of objects and simple situations which can appear when sub-activity su-akh is being executed (by Mas),

[0240] apOSa(AVh,su-akh)—the list (in ZuA(AVh)) of objects and simple situations which actually appear and are listed in exOSa(AVh,su-akh),

[0241] nOSa(AVh,su-akh)—the list of objects and simple situations which just have appeared and are listed in exOSa(AVh,su-akh),

[0242] dOSa(AVh,su-akh)—the list of disappeared objects and simple situations which were listed in apOSa(AVh,su-akh);

[0243] LbOa(Q)—the list of objects, Qi, in which Q was, and activities which Q executed; an element of this list has the following form

EbOa(Qi)=((t1i,t2i),Qi,M(Qi),Lexac(Qi),ZOSa(Qi)), where:

[0244] (t1i, t2i)—the time in which object Q was or is in object Qi,

[0245] Lexac(Qi)—the list of sub-activities which Q executed in object Qi; an element of this list equals:

Eexac(AVe,s-actej)=(AVe, s-actej, t3e,t4e, P(exOSa(AVe,s-actej)), P(apOSa(AVe,s-actej)))

[0246]  when Q executed sub-activity s-actej of the activity AVe, in object Qi from t3e till t4e; the method DKA puts these elements in the list Lexac(Qi);

[0247] ZOSa(Qi):=EOSa(Q) when Q just left object Qi (at time t2i, ZOSa(Qi)=nil if it is in Qi

[0248] Besides the tree TOS, AW(t) contains also other data structures, e.g.

[0249] LB—the list of commands which WP has identified.

[0250] SDW2. WP enters objects and simple situations in the tree TOS as follows:

[0251] SDW2.1. When WP notices, by sensors and the observing operation observ(O1r, . . . ), an object O1r (direct) in a structured object Q (which is recognized as M(Q), in TOS) then:

[0252] i. WP searches for an internal representation, O1, of the object O1r WP attempts to identify O1as an object model M(O) (by the operation IdO(O1,M(O)), s.(ii)) such that M(O) is declared in the model M(Q) or in a model clo(M(Q)) or M(O) occurs in a list exOSa(AVe,su-akej) in the list LOSa(Q) (of the object Q); if this succeeds then O1 is recognized as expected object M(O). If such identification does not succeed then WP searches for object model M(Og), representing O1, in the semantic graph SeG (defined in Sect. 2.2). In this case, O1 is recognized as an unexpected (not foreseen) object M(Og) in Q. WP does the following operations: (a) it puts new object (P(VR(O1)),O1,M(O),., ‘exp’), or (P(VR(O1)), O1,M(Og),., ‘nexp’), in the lists apOS(Q) and nOS(Q), it builds the node KTOS(O1) and connects it as successor with KTOS(Q); (b) it puts the element EbOa(Q)=((t,.),Q,M(Q),Lexac(Q),nil) in LbOa(O1), where Lexac(Q)=nil if O1 does no activity in Q, and Lexac(Q)=(AVo1, s-acto1j,t,., P(exOSa(AVo1, s-acto1j)), P(apOSa(AVo1,sacto1j))) if O1 does sub-activity sacto1j of the activity AVo1; in the latter case (thus if s-acto1j=(O1,.)), WP puts new element EOSa(O1)=(O1,P(exOSa(AVo1, sacto1j)), P(apOSa(AVo1,s-acto1j)),nil,nil) in the list LOSa(Q); (c) if object M(O), or M(Og), occurs in a list exOSa(AVqe,s-akqej), in LOSa(Q), then WP puts (P(VR(O1)),Ol .) in the lists nOSa(AVqe,s-akqej) and apOSa(AVqe,s-akqej) (in LOSa(Q));

[0253] ii. The mentioned identification operation IdO(O1,M(O)) instantiates the model M(O) and builds from it the internal representation O1 of the observed object O1r according to the following rules: (a) when WP notices that a property or an object (if O1 is a structured object), EOi, of the model M(O), does not appear in the observed real object O1r, then EOi does not occur in the instantiation O1 of the model M(O) (if EOi is an object, M(U), which should appear in O1r with probability greater than 0.75, then WP puts M(U) in nfOS(O1) and fOS(O1) (in node KTOS(O1)) as absent object), (b) when the properties and objects EOe, e≦e1, of the object O1r, noticed by WP, sufficient good match those of the model M(O), then O1r is recognized as instantiation O1 of the model M(O) (EOe are of course entered in O1), (c) the properties and objects, EOnb, which occur in the model M(O) and which WP does not notice in the real object O1r (because e.g. they are not visible), WP puts into the instantiation O1 and marks them (in O1) with ‘nver’ (not verified); the not verified objects in O1 WP does not put in the lists apOS(O1), nOS(O1) etc of KTOS(O1).

[0254] iii. WP detects whether new simple situations have appeared in the following way:

[0255] iii.1. If O1 is recognized as expected object (s. (i)), then WP searches, through all simple situations, declared in M(Q) or in a model clo(M(Q) or in a list exOSa(AVqe,s-akqej) (in LOSa(Q)), for a model SMi such that SMi contains model M(O) as a component; if SMi is such situation model, then WP detects an instantiation, S1i, of the model SMi (performed by IdS(S1i,SMi)). If such instantiation S1i is found then S1i is an expected/foreseen situation (recognized as SMi) in object Q.

[0256] iii.2. If O1 has appeared as unexpected object in Q then WP searches, in the semantic graph SeG, for a simple situation model SMgi such that: SMgi contains object M(Og), as a component, and an instantiation, S1i, of SMgi (performed by IdS(S1i,SMgi)) exists in Q. If such instantiation S1i is found in object Q, then S1i is an unexpected/unforeseen situation (recognized as SMgi) in object Q.

[0257] iii.3. WP puts just recognized simple situations (P(VR(S1i)),S1i,SMi,., ‘exp’), or (P(VR(S1i)),S1i,SMgi,., ‘nexp’ ), in the lists apOS(Q) and nOS(Q). If situation SMi (or SMgi) occurs in a list exOSa(AVqe,s-akqej) (in LOSa(Q)), then WP puts (P(VR(S1i)),S1i, . . . ) in the lists nOSa(AVqe,s-akqej) and apOSa(AVqe,sakqej) (in LOSa(Q)).

[0258] SpW2.2. When WP observes by the operation observ that an object O1 (e.g. aS), recognized as M(O), moved from structured object Q1 (recognized as M(Q1)) to structured object Q2 (recognized as M(Q2)) (thus, O1 left object Q1 and appears in object Q2), then:

[0259] i. WP searches for simple situations, S1vi recognized as SMvi, such that: (a) (.,S1vi,SMvi,.,.) is in the list apOS(Q1) and contains object O1 as a component, (b) S1vi is recognized, by IdS(S1vi,SMvi), as ‘is not in Q1’. WP puts (.,O1,M(O), . . . ) and the said disappeared situations (S1vi,SMvi, . . . ) into dOS(Q1) and deletes them in apOS(Q1). If (.,O1,M(O), . . . ), or (.,S1vi,SMvi, . . . ), occurs in a list apOSa(AV1e,su-ak1ej) (in LOSa(Q1)), then WP puts (O1,M(O), . . . ) ((S1vi,SMvi, . . . ), respectively) in the list dOSa(AV1e,su-ak1ej) (in LOSa(Q1)). When O1 does a sub-activity, su-akor, of an activity AVo (i.e. if EOSa(O1)=(O1,P(exOSa(AVo,su-akor)), P(apOSa(AVo,su-akor)), . . . ) is in LOSa(Q1)), then:

[0260] begin E2:=EOSa(O1); delete EOSa(O1) in the list LOSa(Q1); ZOSa(Q1):=E2;

[0261] put ZOSa(Q1) and the actual time t in the list EbOa(Oi) (in the list LbOa(O1)) end.

[0262]  Delete the pointer P(KTOS(O1)) in sK(Q1) (thus, KTOS(O1) ceased to be successor of KTOS(Q1)).

[0263] ii. As said in (i), object O1 was recognized as M(O) in object Q1. WP recognizes O1 in object Q2 as follows:

[0264] Case a: in M(Q2) or clo(M(Q2)) or in a list exOSa(AV2i,su-ak2ij) (in LOSa(Q2)) is declared a model M(Or) such that M(Or) belongs to class M(O) (in graph SeG) and M(Or) is a good model for object O1; then O1 is an expected object in object Q2 and is recognized as M(Or).

[0265] Case b: M(O) or clo(M(O)) is declared in M(Q2) or in clo(M(Q2)) or in a list exOSa(AV2i,su-ak2ij) (in LOSa(Q2)) then O is an expected object in object Q2 and is recognized as M(O).

[0266] Case c: neither case (a) nor case (b) (i.e. in clo(M(Q2)) is no good model for object O1); then O1 is an unexpected object in object Q2 and is recognized as M(O).

[0267] WP puts (.,O1,M(Or), . . . ‘exp’) or (.,O1,M(O), . . . , ‘exp’) or (.,O1,M(O). ‘nexp’) in the lists apOS(Q2) and nOS(Q2). If M(Or) (or M(O)) occurs in a list exOSa(AV2n,su-ak2nj), in LOSa(Q2), then WP puts (.,O1,M(Or), . . . ), (or (.,O1,M(O), . . . )) in the lists apOSa(AV2n,su-ak2nj) and nOSa(AV2n,su-ak2nj) (in LOSa(Q2)). WP puts the pointer P(KTOS(O1)) in sK(Q2) (thus KTOS(O1) is successor of KTOS(Q2)). When O1 does a sub-activity su-akor of an activity AVo (i.e. if element EOSa(O1) was in LOSa(Q1)), then

[0268] begin put new element EbOa(Q2)=(t,.,Q2,M(Q2),Lexac(Q2),nil) in the list EbOa(O1), where

Lexac(Q2)=(AVo,su-akorst,.,P(exOSa(AVo,su-akor)),P(apOSa(AVo,su-akor)));

EOSa(O1:=E2; (s.(i)); put element EOSa(O1) in the list LOSa(Q2) end.

[0269] iii. WP performs analogous operations as in (III), in SpW2.1.

[0270] SDW3. WP identifies simple sentences (their syntax and semantics) of the language which aS uses to communicate with people, emotional systems and robots/agents. An idea of such identification, based on object and situation models in the graph SeG, is given in Schurmann [AS4]. WP puts identified orders in the list LB.

[0271] SDW4. WP identifies simple motion actions of objects; examples: rolling ball, falling plate, eating person, walking Person. WP identifies such motion actions by motion patterns. These motion actions must be registered in object models. Also the possible results of motion actions must be given in their models/descriptions.

[0272] SDW5. WP observes these objects and simple situations, OS, (by an observation activity observ(.,OS,t)) which have the greatest value des(aS,AUw(OS),t) (the intensity of desire for attention when WP perceives OS by sensors, at time t). WP and the method DKA apply the rules given in Schurmann [AS6], which concern the changes of values bef(aS AUw(OS),t), des(aS,AUw(OS),t), bef(aS,NEw(OS),t) and des(aS,NEw(SO),t), when object or situation OS is recognized, where NEw(OS) is the need for curiosity and knowledge with respect to OS. WP applies also the rule AU3 (given in [AS6]), when aS does motion activities. When the attention of WP is focused on part TUr of real surrounding, then WP compares TUr with its representation, Th, in the tree TOS. WP recognizes changes of position and shape of an object O in TUr and puts them in TU. WP detects also whether situation, S(O), which contains object O, has changed. WP updates the modified or new situation S(O‘)’ in TU, where situation S(O) differs from situation S(O‘)’ if they have different situation models.

[0273] 5. Determination and Control of Activities of aS

[0274] In this section I describe the method DKA which is applied in the sub-system DA of aS. To describe this method more clear, I assume that aS is not a virtual system and contains the following simultaneous working processors: at least one processor, PrWP, for the subsystem WP, at least one processor, PrDA, for the sub-system DA, at least one processor, PrA, for the subsystem EX-contr-motion (execution of motions), some processors, PrCOi, i=1, . . . , ip, for computer operations which aS can execute, e.g. cognitive procedures.

[0275] 5.1. Notation

[0276] We use the notations introduced in the previous sections. Additional we denote:

[0277] ZuA(AV)=(AV, Pb, SMae, xa, P(Ly,Ely), tact, tsa, su-act(SM,SMj), motak, exOSa(AV,su-act(SM,SMj)), apOSa(AV,su-act(SM,SMj)), apSa(AV,su-act(SM,SMj)), . . . )—the state of execution of activity AV,

[0278] where: SMae—the initial situation in which the execution of the activity AV began,

[0279] Pb—pointer to command, BOf, in the list LB when AV performs order BOf, Pb=nil otherwise, su-act(SM,SMj)—the execution of the activity AV reached situation SM and now this sub-activity is performed,

[0280] xa=‘exe’ when the sub-activity su-act(SM,SMj) is being executed, xa=‘inter’ when the execution of this sub-activity (thus also the activity AV) is actually interrupted,

[0281] P(Ly,Ely)—pointer to element Ely in the list Ly, where Ly denotes one of the following lists: PAH, LCMR, LuA, LuCO, LuMR; if Ly=PAH (or Ly=LCMR) then the sub-activity su-act(SM,SMj) is being executed by the processor PrA, i.e. by the sub-system Ex-contr-motion, (by a processor PrCOi, a machine, a robot/agent or an emotional system, respectively);

[0282] tact (tsa)—the time period of execution of the activity AV (the sub-activity su-act(SM,SMj), respectively),

[0283] motak—the intensity of motivation to execute activity AV,

[0284] exOSa(AV,su-act(SM,SMj)) (apOSa(AV,su-act(SM,SMj)))—the list of objects and simple situations which can appear (have appeared and are listed in exOSa(AVh,su-akh), respectively) when sub-activity su-act(SM, SMj) is executed,

[0285] apSa(AV,su-act(SM,SMj)—the list of situations which have appeared and are expected in su-act(SM,SMj);

[0286] PAH=(H1,H11,H2, . . . ) registers as follows the state of execution of a sub-activity or control-activity by processor PrA: H1=nil if PrA is free, H1=P(Lexint, ZuA(AV)) and H2=act if PrA is executing su-act(SM,SMj),

[0287] H5=‘end’ if PrA finished the sub- or control-activity registered in H1, if H1=P(Lexint,ZuA(AV))) and H2=‘co-a’ then PrA is executing the control-activity contr-su-actj of the sub-activity in ZuA(AV); in this case holds: in H11 is the pointer to the elementary activities in contr-su-actj which PrA is now executing, if H3=‘el-ak1’ then PrA is doing the elementary activities OApji1; . . . ; OApja (before observ( . . . )) (if these activities are finished then H5=‘end1’), if H3=‘obser’ then observ( . . . ) is being executed and in H4 is the time at which the operation observ( . . . ) began, if H3=‘cakt’ then a control action CAje is being executed;

[0288] Lexint—the list of activity states ZuA(AVp), for activities which actually are executed or interrupted;

[0289] LCMR—the list of activities being actually executed by a processor PrCOi, a machine, an agent/robot or an emotional system; ECMR(AVY)=(P(Lexint,ZuA(AVy)), Mas, Resyj) is an element of this list, where Mas is the object which does the sub-activity in ZuA(AVy) and Resyj denotes the resources which are used by the sub-activity in ZuA(AVy);

[0290] LuA—the list of pointers P(Lexint,ZuA(AVai)) to ZuA(AVai) (in Lexint) such that the sub-activity in ZuA(AVai) is waiting for execution by the processor PrA;

[0291] LuCO—the list of pointers P(Lexint,ZuA(AVci)) to ZuA(AVci) such that the sub-activity in ZuA(AVci) is waiting for execution by a processor PrCOn;

[0292] LuMR—the list of pointers P(Lexint,ZuA(AVri)) to ZuA(AVri) such that the sub-activity in ZuA(AVri) is waiting for execution by a machine, an agent/robot or an emotional system; EuMR(AVri)=(P(Lexint,ZuA(AVri)), Resrj) is an element of this list, where Resrj denotes the resources which the sub-activity in ZuA(AVri) needs;

[0293] LAst—the list of activities waiting for start of execution.

[0294] The execution of a sub-activity, su-acj, or control-activity, contr-su-actj, by the processor PrA (which can use several processors) is performed and controlled by a software Ex-contr-motion. Ex-contr-motion performs and controls the motion activities of aS. The performance of motions by Ex-contr-motion is not subject of this patent description. How such software can be developed is described in Meystel & Albus [MeA] (2002); thereby, motion patterns, for standard motions, and surface and spatial patterns, where these motion patterns are applied, should be used.

[0295] To make the description of the method DKA more clear, I give first (in Sect. 5.2) the structure of the method and after that a more detailed general description. In Sect. 5.3, I give the complete description of the method DKA.

[0296] 5.2. General Outline of the Method DKA

[0297] DKA consists of the following steps:

[0298] D1.1. build list LdmS (with elements dmS(Q)) of meta-situations which are disappeared from the surrounding represented by TOS, where Q is a structured object; delete disappeared objects and situations in TOS;

[0299] D1.2. build list LS1 of situations which have appeared in connection with activities which are being executed or interrupted;

[0300] D1.3. build list LS2 of situations which just have appeared in structured objects in TOS;

[0301] D1.4. initiate the performance of received commands—for commands to execute an activity, AVf, put AVt in the list LAst of activities which should be executed;

[0302] D1.5. build list LnexS of objects and situations which have appeared in structured objects in TOS, although they are not expected/not foreseen there;

[0303] D1.6. build list LOSf of objects and situations just recognized as absent/missed in structured objects in TOS, although they should be there;

[0304] D2. initiate the execution of these activities in the list LAst (s. D1.4) which have great enough priorities and the resources needed for their executions are available;

[0305] D3. control the execution of sub-activities as follows:

[0306] D3.1. when processor PrA executes control-activity of a sub-activity, then update the state of this execution;

[0307] D3.2. control sub-activities, suAyj, listed in LS1 (s. D1.2) as follows: determine new sub-activity and initiate its execution or close the execution of the activity in which the sub-activity suAyj occurs, when the execution of the sub-activity suAyj is finished;

[0308] D3.3. if the duration of execution of a sub-activity lasts too long then abandon the execution of the activity in which this sub-activity occurs;

[0309] D4. control and determine execution of activities which are being executed or interrupted as follows:

[0310] D4.1. when the duration of execution of an activity lasts too long then abandon this execution;

[0311] D4.2. choose from activities in the list LuA, which are waiting for execution by the processor PrA, the activity, AVg, with maximum motivation;

[0312]  if this motivation is greater than the motivation connected with the sub-activity or control-activity, su-contr-acj, actually being executed by the processor PrA, then interrupt the execution of su-contr-acj and begin to continue the execution of the activity AVg;

[0313] D4.3. choose from activities in the list LuCO, which are waiting for execution by a processor PrCOn, activities, AVg1, . . . , AVgv, such that the motivation to execute activity AVgi (in the actual state of execution ZuA(AVgi)) is greater than the motivation to execute activity AVji actually being executed by a processor PrCOki, for i=1, . . . , v, where AVji=nil if processor PrCOki is free;

[0314]  interrupt the execution of activities AVj1, . . . , AVjv and begin to continue the execution of activities AVg1, . . . , AVgv by processors PrCOk1, . . . , PrCOkv;

[0315] D4.4. choose from activities in the list LuMR, which are waiting for execution by a machine, an agent/robot or an emotional system, activities, AVw1, . . . , AVwf, such that:

[0316] 1) the present motivation to execute activity AVwi is relatively great;

[0317] 2) either: (i) there are free resources (needed objects e.g. devices, machines, rooms) to continue the execution of the activity AVwi,

[0318]  or: (ii) (a) the motivation to execute activity AVwi is greater than the motivation to execute an activity AVsi actually being executed, (b) if the activity AVsi is interrupted, then there will be free resources for execution of the activity AVwi, (c) the activity AVsi can be interrupted;

[0319]  for i=1, . . . , f do: begin if case (2.ii) then interrupt the activity AVsi;

[0320] continue the execution of the activity AVwi end;

[0321] D5. for each situation, SMae, (in LS2) which has appeared in a structured object (in TOS) do:

[0322] determine activity, AVp, with maximum motivation, which handle the situation SMae; if such activity is determined and the motivation to execute the activity AVp is relatively great, then put (SMae, AVp) in the list LAst of activities which should be executed end;

[0323] D6. for each situation, SMgie, (in the list LnexS, s. D1.5), which has appeared in a structured object, Q, (in TOS) but is not foreseen there, determine an activity, AVa, such that: it handles the situation SMgie, it can be executed in object Q and the motivation to execute it is great enough; put (SMgje, AVg6) in the list LAst;

[0324] D7. for objects and situations, OSfi, (in the list LOSf, s. D1.6) that have not appeared in structured objects, Q, (in TOS), although they should appear there do: begin determine an activity, AVgi, such that: it copes with the problem of absent/missed OSfi, it can be executed in object Q and the motivation to execute it is great enough; put (OSfi, AVgi) in the list LAst end;

[0325] D8. update the relevant lists in AW(t); apply the rule RWAN1 (s. Sect. 3.3) and the rules given in Schurmann [AS6], which should be applied every time period (e.g. AU1, GR3, MA4); store the most important objects and situations, with relevant lists, which are in AW(t), in AW(tμ) (μ:=μ+1), after every given time period; goto D1.1

[0326] More Detailed Outline of Steps D1.1, . . . , D7

[0327] D1.1. for each non empty list dOS(Q) (the list of disappeared objects and simple situations in object Q, in TOS) do: beg dOS1(Q):=dOS(Q); dOS(Q):=nil;

[0328] dmS(Q):=the list of disappeared meta-situations in object Q (they contain at least one object or one situation from dOS1(Q) as component;

[0329] delete the meta-situations in amS(Q) (in KTOS(Q)), which are listed in dmS(Q);

[0330] for objects and situations in the list dOS1(Q) and dmS(Q) do: begin determine new values bef(aS,b,t) and des(aS,b,t) (intensities of satisfactions and desires) caused by disappeared objects and situations listed in dOS1(Q) and dmS(Q), by applying the relevant rules given in Sect. 2.1 and Schurmann [AS6]; apply the relevant rules given in Schurmann [AS5], with respect to the said changes of values bef(aS,b,t) and des(aS,b,t), to update emotion intensities end end;

[0331] D1.2. LS1:=nil; using the lists LOSa(Q) and dmS(Q) in the tree TOS build lists:

[0332] EnOSa2(AVh)—of objects and simple situations which just have appeared and are expected when the sub-activity in ZuA(AVh) is being executed;

[0333] EdOSa2(AVh)—of objects and simple situations which appeared when the sub-activity in ZuA(AVh) has been executed, and which now have disappeared;

[0334] nmSa(AVh)—of just appeared meta-situations which are expected when the sub-activity in ZuA(AVh) is being executed;

[0335] dmSa(AVh)—of meta-situations which appeared when the sub-activity in ZuA(AVh) is being executed, and which now have disappeared;

[0336] update the relevant lists in ZuA(AVh) using the lists EdOSa2(AVh) and dmSa(AVh);

[0337] update the list apOSa(AVh) in ZuA(AVh) using the list EnOSa2(AVh), and after that, build the list ES1(AVh) (element of the list LS1) of just appeared situations which are expected in ZuA(AVh), using nmSa(AVh);

[0338] D1.3. LS2:=nil; for objects Q in the tree TOS, build list ES2(Q) (element of the list LS2) as follows:

[0339] begin put each simple situation expected in Q and occurring in the list nOS(Q) (in the node KTOS(Q), marked with ‘exp’) into the list ES2(Q) in the following form:

ES2(Q)=(Q, M(Q), (as1S11,SM1,dS(S11,SM1),Ioc(S11)), . . . , (ask,S1k,SMk,IdS(S1k,SMk),Ioc(S1k))),

[0340]  where: situations SMi are foreseen in structured object M(Q), object Q is recognized as M(Q), S1i is recognized as SMi, asi=(‘sf’,SFi) if SMi belongs to situation sequence SFi (occurring in M(Q)), and asi=(‘mc’,nil) if SMi does not belong to a situation sequence in M(Q), and loc(S1i) denotes the actual location of the situation S1i in VR(Q) (if S1i is a visual situation);

[0341] detect meta-situations which just have appeared in Q and are expected in object M(Q), using the lists nOS1(Q), apOS(Q) and amS(Q), and put them into the lists ES2(Q) and amS(Q);

[0342] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, with regard to the just appeared new meta-situations end;

[0343] D1.4. for each command, BOf, in the list LB of the received orders, do: begin

[0344] increase the desires des(aS,WA(Pa),t) (to do orders received from Pa) and des(aS,AN,t) (for recognition acknowledgment and self-esteem) according to the rule RWAN2 (s Sect. 3.3);

[0345] if BOf is an order, from authorized Pa, to abandon an (or to continue the execution of an abandoned) activity, AVg, then: begin abandon the (continue the execution of the abandoned, respectively) activity Avg;

[0346] update bef(aS,WA(Pa),t), des(aS,WA(Pa),t), bef(aS,AN,t) and des(aS,AN,t) with regard to the order BOf from Pa; apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVg has been abandoned—no goal situation of this activity will be reached” (“probably a goal situation of the activity AVg will be reached”, respectively) end;

[0347] if BOf is an order to execute an activity AVf then put the activity AVf in the list LAst of activities which should be executed end;

[0348] D1.5. for structured objects, Q, in the tree TOS, build elements EnexS(Q) of the list LnexS of not foreseen situations, as follows: begin

[0349] put each not expected simple situation (marked with ‘nexp ’) from nOS(Q) into the list EnexS(Q);

[0350] using lists nOS(Q) and apOS(Q), detect all new meta-situations, mSge, such that: (a) at least one unexpected object or situation in nOS(Q) is a component of the meta-situation mSge, (b) mSge is recognized as model mSMge and mSMge is not foreseen in object M(Q); put (mSge,mSMge) in the list EnexS(Q);

[0351] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t),

[0352] des(aS,b,t) and other emotion intensities, in the case “unexpected meta-situation mSge has appeared” end;

[0353] D1.6. for structured objects, Q, in the tree TOS, add new elements to the lists EOSf(Q) and fmS(Q) (of absent/missed meta-situations in object Q) as follows:

[0354] begin EOSf(Q) (element of the list LOSf) has the form

(Q,M(Q),ob(pr(Of1),M(Of1)), . . . , (pr(Of a),M(Of a)); sit(pr(Sf1),SMf1), . . . , (pr(Sfs),SMfs))

[0355] where pr(Ofi), or pr(Sfe), (given in M(Q)) denotes the probability that object M(Ofi) (situation SMfe, respectively) appears in object Q—for these elements hold: pr(Ofi)>0.75, pr(Sfe)>0.75;

[0356] using the absent/missed objects and simple situations registered in EOSf(Q) and fOS(Q) (the latter list is built by WP), recognize meta-situations, mSMfe, which are not in object Q, although they should appear there, and are not in the list fmS(Q);

[0357] put these situations (pr(mSfe),mSMfe) in the lists EOSf(Q) and fmS(Q) end;

[0358] D2. initiate the execution of activities in the list LAst as follows: for each activity, AVg, in the list LAst do: if (a) aS can reach an initial situation of the activity AVg by motions or by sending a message, (b) the resources for execution of the activity may be available, (c) the priority prior-a(.,AVg,t) of the activity AVg is great enough, compared with priorities prior-a(.,AVxw,t) of activities AVxw waiting for execution then begin

[0359] build the initial execution state ZuA(AVg) of the activity AVg;

[0360] put ZuA(AVg) in the list Lexint; put the pointer to ZuA(AVg), in Lexint, into the relevant list (LuA, LuCO or LuMR) of activities waiting for execution;

[0361] apply the rule BZ1 given in [AS6] end else begin if AVg has to perform an order then issue a message explaining the reason why this order is not done till now end;

[0362] D3. control the execution of sub-activities as follows:

[0363] D3.1. when processor PrA executes a control-activity, contr-su-actj, then update the execution state of contr-su-actj;

[0364] D3.2. for each element ES1(AVy) in the list LS1 do: begin

[0365] when the execution of the sub-activity, suAyj, occurring in ZuA(AVy) is finished then begin update the execution state ZuA(AVy);

[0366] if the execution of the activity AVy is finished then begin close the execution of the activity AVy;

[0367] put the reached end situation, SMyi, of the activity AVy, in the list LS2;

[0368] if AVy performed a command then apply the rule RWAN3 (s. Sect. 3.3);

[0369] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVy is finished and the end situation SMyi has been reached” end else

[0370] begin apply the rules BZ2.1, BZ2.3,. given in [AS6], the rules in Sect. 2.1 and the relevant rules given in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “between situation SMyi of the activity AVy is reached”;

[0371] determine the next sub-activity in AVy which should be executed;

[0372] if this next sub-activity contains a control-activity then put the pointer to this control-activity into the list LUA; update ZuA(AVy) end end;

[0373] D3.3. sn :=sn+1; if sn>sn1 then begin

[0374] for each activity, AVy, being executed or interrupted do begin

[0375] if the duration of execution of the sub-activity in ZuA(AVy) lasts too long then begin abandon the execution of this sub-activity and the activity AVy;

[0376] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVy is abandoned—none goal situation of this activity will be reached” end end end;

[0377] D4. control the execution of activities as follows:

[0378] D4.1. an :=an+1; if an>an1 then begin

[0379] for each activity, AVy, being executed or interrupted do begin if the duration of execution of the activity AVy lasts too long then begin abandon the execution of the activity AVy;

[0380] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVy is abandoned—none goal situation of this activity will be reached” end end end;

[0381] D4.2 control the execution of sub- and control-activities by processor PrA as follows:

[0382] begin choose from activities in the list LuA, which are waiting for execution or control by the processor PrA, the activity, AVg, with the maximum motivation to execute its current sub- or control-activity, su-co-actgi, which is in ZuA(AVg);

[0383] if processor PrA is free then begin begin the execution of su-co-acw by the processor PrA; update ZuA(AVg) and the list LuA end else begin

[0384] let sub- or control-activity, su-co-act-vh, of an activity AVa, is being executed by processor PrA;

[0385] if the execution of su-co-act-vh can be interrupted then begin

[0386] if the motivation to execute su-co-actgi is greater than the motivation to execute su-co-act-vh then

[0387] begin interrupt the execution of su-co-act-vh; update ZuA(AVa) and the list LuA;

[0388] begin the execution of su-co-actgi by the processor PrA; update ZuA(AVg) and the list LuA end end end end;

[0389] D4.3. control the execution of activities by processors PrCOn as follows:

[0390] if LuCO nil then nex :=false; repeat

[0391] choose from activities in the list LuCO, which are waiting for execution by a processor PrCOn, activity, AVg, with the maximum motivation to execute its current sub-activity, su-act, which is in ZuA(AVg);

[0392] if a processor, PrCOf, is free then m :=f else choose from the set

[0393] {AVy| activity AVy (i.e. its current sub-activity, su-actye, which is in ZuA(AVy)) is being executed by a processor PrCOky and the sub-activity su-actye can be interrupted}

[0394] the activity, AVs, with the minimum motivation to execute its current sub-activity, su-actse;

[0395] if such activity AVs is chosen and the motivation to execute the sub-activity su-actgi is greater than the motivation to execute the sub-activity su-actse then begin interrupt the execution of the sub-activity su-actse (thus, also the activity AVs) by the processor PrCOks; m :=ks;

[0396] update ZuA(AVs) and the lists LuCO and LCMR end else nex :=true end;

[0397] if nex=false then begin begin the execution of the sub-activity su-actgi (of the activity AVg) by the processor PrCOm; delete the element with the pointer to ZuA(AVg), in the list LuCO;

[0398] update ZuA(AVs) and the lists LuCO and LCMR end

[0399] until nex=true v LuCO=nil end;

[0400] D4.4. control the execution of activities by a machine, robot, agent (Maxs) as follows:

[0401] LuM1:=LuMR (the list of activities waiting for execution by a Maxs);

[0402] while LuM1≠nil do begin choose, from activities in the list LuMl, activity, AVg, with the maximum motivation to execute its current sub-activity, su-actgi, which is in ZuA(AVg);

[0403] let the sub-activity su-actgi should be executed by Magi and let Resgi are the resources needed for execution of su-actgi;

[0404] if there are free resources Resga and Magi is free then isf :=true else begin

[0405] find, in the list LCMR of activities actually being executed by objects, activity, AVs, such that: (a) AVs, i.e. the sub-activity (su-actse) in ZuA(AVs), is actually being executed by Magi, if Magi is not free, (b) the motivation to execute the sub-activity su-actgi is greater than the motivation to execute the sub-activity su-actse, (c) the execution of the sub-activity su-actse can be interrupted at present time, (d) if the execution of the sub-activity su-actse is interrupted then there will be free MagV and the resources Resg (for execution of the sub-activity su-actgi);

[0406] if such activity AVs is found then begin isf :=true;

[0407] interrupt the execution of the sub-activity su-actse (thus, also the activity AVs);

[0408] update ZuA(AVs) and the lists LuMR and LCMR end else isf :=false end;

[0409] if isf=true then begin begin the execution of the sub-activity su-actgi (of the activity AVg) by Magi;

[0410] delete the element EuMR(AVg) in the list LuMR, and update ZuA(AVg) and LCMR end;

[0411] delete the element EuM1(AVg) in the list LuM1 end;

[0412] D5. handle each foreseen situation which has appeared in a structured object, Q, and is registered in the list LS2 (built in D1.3 and D3.2) as follows:

[0413] for each element ES2(Q)=(QM(Q),(as1,Sa1,SMa1,.,.), . . . , (ask,Sak,SMak,.,.)) in LS2 (s. (5.1)) do:

[0414] begin for each situation SMae in ES2(Q) do: begin

[0415] if SMae belongs to a situation sequence, FSh, then register in FSh that SMae has appeared;

[0416] find activity, AVp, in AK(SMae), with the greatest motivation such that: (a) the resources needed for execution of the activity AVp could be available, (b) AVp can be executed in object Q, (c) the motivation to execute AVp is great enough;

[0417] if such activity AVp is found then begin put (SMae,AVp) in the list LAst of activities which should be executed; delete (ase,Sae,SMae,.,.) in ES2(Q) end end end;

[0418] D6. handle not foreseen situations which have appeared in structured objects in TOS and are registered in the list LnexS (s. D1.5) as follows:

[0419] for each element EnexS(Q)=(Q,M(Q),(as1,Sa1,SMa1,.,.), . . . , (ass,Sas,SMas,.,.)) in LnexS do:

[0420] begin determine activities, AVgi, j=1, . . . , w, such that: (a) a situation, SMgie, in EnexS(Q) is initial situation of the activity AVgi, (b) AVgi can be executed in object Q, (c) the motivation to execute AVgi is great enough, (d) the resources needed for execution of AVgi may be available;

[0421] put these activities (SMgie,AVgi), j=1, . . . , w, in the list LAst, to execute them end;

[0422] D7. handle objects and situations, in the list LOSf (with elements EOSf(Q), s. D1.6), which are not appeared in structured objects in TOS, although they should be there, as follows:

[0423] for each element EOSf(Q)=(Q,M(Q), ob (pr(Of1),M(Of1)), . . . , (pr(Of a),M(Of a)); sit (pr(Sf1),SMf1), . . . , (pr(Sfd),SMfd)) in LOSF do: bgn build the following situations:

[0424] SOfi :=object M(Ofi) is not appeared in object Q, although it should be there with probability pr(Ofi), for i=1, . . . , a;

[0425] SMFe :=situation SMfe is not appeared in object Q, although it should be there with probability pr(Sfe), for e=1, . . . , d;

[0426] increase the attention to situations SOfi, i=1, . . . , a, and SMFe, e=1, . . . , d, according to the relevant rules given in [AS6]; apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, with regard to the appeared situations SOfi, i=1, . . . , a, and SMFe, e=1, . . . , d;

[0427] WSF :={SF| SF=SOfi, i≦a, and |rosa(aS,SOfi,t)|>10 or SF=SMFe, e≦d, and |rosa(aS,SMFe,t)|>10} (situations which are not in WSF are unimportant for aS);

[0428] determine activities, AVgi, i=1, . . . , w, such that: (a) a situation, SFgij, in WSF, is an initial situation of the activity AVgi, (b) AVgi can be executed in object Q, (c) the motivation to execute AVgi is great enough, (d) the resources needed for execution of AVgi may be available;

[0429] put these activities (SFgij, AVgi), i=1, . . . , w, in the list LAst, to execute them end;

[0430] 5.3. Complete Description of the Steps D1.1, . . . , D7

[0431] D1.1. for each structured object, Q, in the tree TOS build lists: begin

[0432] nOS1(Q):=nOS(Q); nOS(Q):=nil (in KTOS); dOS1(Q):=dOS(Q); dOS(Q):=nil;

[0433] EOSf(Q):=nfOS(Q) (EOSf(Q) is new element of the list LOSt); nfOS(Q):=nil;

[0434] for elements EOSa(Masi) of the list LOSa(Q), build elements: begin

[0435] nOSa1(AVh,su-akhj):=nOSa(AVh,su-akhj); nOSa(AVh,su-akhj):=nil (in EOSa(Masi));

[0436] dOSa1(AVh,su-akhj):=dOSa(AVh,su-akhj); dOSa(AVh,su-akhj):=nil;

[0437] EOSa1(Q,Masi)=(nOSa1(AVh,su-akhj), dOSal(AVh,su-akhj) end;

[0438] for each list dOS1(Q) (of disappeared objects and simple situations in Q) do: build list dmS(Q) of disappeared meta-situations, mSMds, in object Q using the lists dOS1(Q) and amS(Q) (mSMds must have at least an object or a situation, listed in dOS1(Q), as component. and mSMds must be registered in the list amS(Q) and recognized by the procedure IdmS as not present in Q );

[0439] delete these meta-situations in the list amS(Q), which are in dmS(Q);

[0440] for objects, Odi, and situations, SMde, in the lists dOS1(Q) and dmS(Q) do: begin

[0441] decrease the attention and the desire for curiosity with regard to Odi and SMde, i.e. decrease the values des(aS,AUw(Odi), t), des(aS,AUw(SMde),t), des(aS,NEw(Odi),t), des(aS,NEw(SMde),t), according to relevant rules in [AS6];

[0442] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “object Odi, or situation SMde, is disappeared from object Q” (examples of such rules in [AS6]: MA3.1.1, MA3.2.1, MA3.3.1) end;

[0443] D1.2. LS1:=nil; for each list LOSa(Q) in the tree TOS do: begin

[0444] using the lists nOSa1(AVh,su-akhj) and dOSa1(AVh,su-akhj) in the lists EOSa1(Q,Masi), and the lists dmS(Q) in TOS, build lists: begin

[0445] EnOSa2(AVh)—of just appeared objects and simple situations (with the time point of identification by WP) which are expected when the sub-activity su-akhj, which is in ZuA(AVh), is being executed;

[0446] EdOSa2(AVh)—of objects and simple situations which appeared when the sub-activity su-akhj, which is in ZuA(AVh), is being executed, and which now have disappeared;

[0447] dmSa(AVh)—of meta-situations which appeared when the sub-activity su-akhj is being executed, and which now have disappeared (meta-situations in this list are in the list apSa(AVh,su-akhj), in ZuA(AVh), and in a list dmS(Q));

[0448] nmSa(AVh)—of new appeared meta-situations (with the time point of identification) which are declared as expected in the sub-activity su-akhj (these meta-situations must contain as component at least one object or situation from EnOSa2(AVh)) end;

[0449] for elements EnOSa2(AVh), EdOSa2(AVh) and dmSa(AVh) do: begin

[0450] mark these situations with ‘was’ (as was been), in the list apSa(AVh,su-akhj), which are in the lists EdOSa2(AVh) and dmSa(AVh),;

[0451] mark these objects and simple situations with ‘was’ (as was been), in the list apOSa(AVh,su-akhj) (in ZuA(AVh)), which are in the list EdOSa2(AVh);

[0452] put all objects and situations from EnOSa2(AVh) into apSa(AVh,su-akhj) and mark them with ‘is’;

[0453] ES1(AVh):=the list of new situations which have appeared when the sub-activity su-akhj (in ZuA(AVh)) is being executed, and which are expected in su-akhj—each situation in ES1(AVh) is either in EnOSa2(AVh) or in nmSa(AVh), and is foreseen in su-akhj (ES1(AVh) is an element of the list LS1);

[0454] put all situations from the list ES1(AVh) into the list apSa(AVh) (in ZuA(AVh)) end end;

[0455] D1.3. LS2:=nil; build lists ES2(Q) (elements of the list LS2) of just appeared and expected situations in structured objects, Q, as follows: begin

[0456] put all new simple situations which are expected in M(Q), from the list nOS1(Q) (expected situations are marked with ‘exp’) into the list ES2(Q), as given in (5.1);

[0457] using the lists nOS1(Q), apOS1(Q) and amS(Q) detect (using the procedure IdmS) new appeared meta-situations, mSMne, such that mSMne contains at least one object or simple situation from nOS1(Q) as component and mSMne is not in amS(Q); if such situation mSMne is recognized then put mSMne in the lists ES2(Q) and amS(Q);

[0458] delete these object and situation models in fOS(Q), EOSf(Q) and fmS(Q), which are in nOS1(Q) and ES2(Q);

[0459] for objects, O1i, in nOS1(Q) and situations, S1e, in ES2(Q) do: beg increase the attention and the desire for curiosity with regard to O1i and S1e, i.e. increase the values des(aS,AUw(O1i),t), des(aS,AUw(S1e),t), des(aS,NEw(O1i),t), des(aS,NEw(S1e),t), according to the relevant rules in [AS6];

[0460] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “object O1i, or situation S1e, is appeared in object Q” end end;

[0461] D1.4. for each command, BOf, in the list LB of received orders do: begin

[0462] if order BOf is given from an authorized person or system, Pa then begin

[0463] des(aS,WA(Pa),t):=min(des(aS,WA(Pa),t)+1.5* (wg(BOf)+2.5* ag(Pa)), 18*ag(Pa));

[0464] des(aS,AN,t):=min(des(aS,AN,t)+1.5*(wg(BOf)+2.5*ag(Pa)), 18*ag(Pa));

[0465] where WA(Pa), wg(BOf) and ag(Pa) are explained in Sect. 3.3 end;

[0466] if BOf is an order, from authorized Pa, to abandon the execution of an activity, AVg (s. rules RPa1, RPa2 in Sect. 3.3) then begin abandon the execution of the activity AVg;

[0467] put (BOf, ZuA(AVg), . . . ) in the list LabAo of abandoned activities (by a command);

[0468] delete ZuA(AVg) in Lexint and update the relevant list PAH, LCMR, LuA, LuCO, LuMR;

[0469] bef(aS,WA(Pa),t):=min(bef(aS,WA(Pa),t)+wg(BOf)+2.5* ag(Pa), 8.5*ag(Pa)) (s. Sect. 3.3);

[0470] des(aS,WA(Pa),t):=max(des(aS,WA(Pa),t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa));

[0471] bef(aS,AN,t):=min(bef(aS,AN,t)+(wg(BOf)+2.5*ag(Pa)), 8.5*ag(Pa));

[0472] des(aS,AN,t):=max(des(aS,AN,t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa));

[0473] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVg is abandoned—no goal situation of this activity will be reached” end

[0474] else begin f BOf is an order, from authorized Pa, to continue the execution of an abandoned activity, Avg, which is registered in the list LabAo or LabD then begin

[0475] put ZuA(AVg) from the list LabAo or LabD into the list Lexint;

[0476] update ZuA(AVg) and put the pointer P(Lexint,ZuA(AVg)) to ZuA(AVg), in Lexint, into the relevant list LuA, LuCO or LuMR (of interrupted activities waiting for execution);

[0477] bef(aS,WA(Pa),t):=min(bef(aS,WA(Pa),t)+wg(BOf)+2.5* ag(Pa), 8.5*ag(Pa)) (s. Sect. 3.3);

[0478] des(aS,WA(Pa),t):=max(des(aS,WA(Pa),t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa));

[0479] bef(aS,AN,t):=min(bef(aS,AN,t)+(wg(BOf)+2.5*ag(Pa)), 8.5*ag(Pa));

[0480] des(aS,AN,t):=max(des(aS,AN,t)−1.9*(wg(BOf)+2.5*ag(Pa)), 1.6*ag(Pa)); apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “activity AVg will be executed—a goal situation of this activity can be reached” end

[0481] else begin if BOf is an order, from authorized Pa, to execute an activity, Avf then begin

[0482] determine an initial situation, SMfae, of the activity AVf such that: (a) from SMfae can be reached a good goal situation of the activity AVf, i.e. motakt is relative great, where motakt is the result of the operation mot(aS,SMfae,AVf,t,motakt,pg,SMfg,t2,art,zv), (b) aS can reach the situation SMfae by some elementary (motion) activities OAfa1; . . . ; OAfar;

[0483] if such initial situation SMfae is determined then put (‘ord’, BOf,Pa,AVf,SMfae,OAf1, . . . , OAfr, . . . ) in the list LAst (the list of activities which should be executed)

[0484] else inform Pa that no initial situation of the activity AVf is within reach at the present time end

[0485] else inform Pa that “I” will not perform the command BOf end end end;

[0486] D1.5. for structured objects, Q, in the tree TOS, build lists EnexS(Q) (element of the list LnexS) of not foreseen situations in object Q as follows: begin LnexS :=nil;

[0487] put each not foreseen simple situation, marked with ‘nex’, from the list nOS1(Q) into EnexS(Q);

[0488] using the lists nOS1(Q) and apOS(Q), detect all new appeared meta-situations, mSge, such that: (a) at least one unexpected object or unexpected simple situation in nOS1(Q) is an essential component of meta-situation mSge, (b) mSge is recognized by the procedure IdmS as model mSMge and mSMge is not expected in the object model M(Q), (c) all components of the situation mSge have appeared in Q;

[0489] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t),

[0490] des(aS,b,t) and other emotion intensities, in the case “new unexpected situation mSge is appeared in Q”;

[0491] put the new recognized meta-situations (mSge,mSMge) into EnexS(Q) and amS(Q) (with ‘nexp’) end;

[0492] D1.6. in elements EOSf(Q) of the list LOSf are the recognized objects and simple situations which are not appeared in object Q, although they should be present in Q; let (s. D1.6 in Sect. 5.2):

[0493] EOSf(Q):=(Q,M(Q),ob (pr(Of1),M(Of1)), . . . , (pr(Of a),M(Of a)); sit (pr(Sf1),SMf1), . . . , (pr(Sfs),SMfs));

[0494] using the objects and simple situations in EOSf(Q) and fOS(Q), detect meta-situations, mSMfe, which are not appeared in Q, although they should be present in Q (according to the model M(Q)), and which do not occur in the list fmS(Q);

[0495] put these situations (pr(mSfe),mSMfe) (for pr(mSfe)>0.75) into the lists EOSf(Q) and fmS(Q);

[0496] D2. we use the procedure mot and functions introduced in Sect. 3.1 and 3.3; let

[0497] function priority((SMae,AW,t): real;

[0498] begin mot(aS,SMae,AVy,t,motacty,pc,SMc,t3,art,zv);

[0499] if zv≦−1.2 min then priority :=−100000 else begin if activity AVy is not performing a command then

[0500] priority.=motacty*4.5/sqrt(zv+16) else priority:=mot-ord(aS,BOf,AVyS,Mae,Pa,t)*4.5/sqrt(t2—t-16), where

[0501] t2=to+zt(BOf) and aS received the order BOf at time to end end;

[0502] initiate the execution of activities in the list LAst as follows: begin LAst1 :=nil;

[0503] for elements EAst(AVi) in LAst do begin

[0504] if EAst(AVi)=(‘ord’,BOfi,Pai,AVi,SMaie, . . . ) then begin if t2−t≦−1.2 min then begin because the execution of activity AVi is behind time, ask Pai whether the activity AVi should be executed end else

[0505] begin if the initial situation SMaie in EAst(AVi) can still be reached then EAst1(AVi):=EAst(AVi) where EAst1(AVi) is element of the list LAst1 else begin detect new initial situation, SMain, such that aS can reach SMain by some motion activities OAin1, . . . , OAinr and from SMain can be reached an acceptable goal situation by the activity AVi;

[0506] if such initial situation is detected then begin put SMain and OAinj, j=1, . . . , r, in EAst(AVi);

[0507] EAst1(AVi):=EAst(AVi) end else begin inform Pai that, at present, no good initial situation of the activity AVi can be reached end end end end end;

[0508] while LAst1 ≠ nil do begin choose activity, AVg, from LAst1, such that

[0509] priority(SMgae,AVg,t)=max(priority(SMsai,AVs,t), for EAst1(AVs) in LAst1);

[0510] if the needed resources (also processor PrA and agents/robots) for execution of activity AVg are not free then fr :=true else

[0511] begin detect activities AVx1, . . . , AVxm, in the list Lexint, such that: (a) the sub-activities in ZuA(AVxi), i≦m, are being executed now, (b) priority(SMgae,AVg,t)≧1.1* max(priority(SMxian,AVxi,t), for i≦m), where SMxian is the initial situation at which the execution of AVxi began, (c) if the executions of the sub-activities in ZuA(AVxi), i≦m, are interrupted, then the resources needed for execution of the activity AVg will be free;

[0512] if such activities AVxi, i≦m, are determined then fr :=true else fr:=false end;

[0513] if fr=true then begin build the initial execution state, ZuA(AVg), of the activity AVg (e.g. put motactg in ZuA(AVg)) and put this state in the list Lexint, and put the pointer to ZuA(AVg) (in Lexint) into the relevant list LuA, LuCO, LuMR;

[0514] apply the rule BZ1 given in [AS6]; delete EAst1(AVg) and EAst(AVg) in the lists LAst1 and LAst end else delete EAst1(AVg) in LAst1 end end;

[0515] D3. control the execution of sub-activities in the list Lexint as follows:

[0516] D3.1. if processor PrA is executing a control-activity, contr-su-actyj, of a sub-activity in ZuA(AVy), i.e. in PAH are values H1=pointer to ZuA(AVy) in Lexint and H2=‘co-ac’ then begin

[0517] if H3=‘el-ak1’ then begin if H5=‘end1’ then begin H3:=‘obser’; H5:=nil; H4:=t;

[0518] H11:=pointer to observ(tatyj,FOSMyj;t) in contr-su-actyj end end else begin

[0519] if H3=‘obser’ then begin if H5=‘endobs’ (this value assigns to H5 the subsystem Ex-contr-motion, after execution of observ(tatyj, . . . )) then begin H3:=‘obs-sit’; H4:=t; H5:=nil end end else gin

[0520] if H3=‘obs-sit’ and t-H4>ctob then begin using the list apSa((AVy,su-act(.,.)) in ZuA(AVy) and ES1(AVy), find the first situation expression sitExpyje in contr-su-actyj which holds (i.e. the situation sitExpyje is appeared); H3:=‘c-akt’; H5:=nil; H11:=pointer to the elementary activities OAxyje1; . . . ; OAxyjef (in CAyje) in contr-su-actyj end else begin

[0521] if H3=‘c-akt’ then begin if H5=‘end’ then gin (contr-su-actyj is performed) atyj :=0 (in contr-su-actyj); PAH:=nil end end end end end end;

[0522] D3.2. for each element ES1(AVy)=(AVy, P(Lexint,ZuA(AVy)), (sy1,SMy1); . . . , (Syp,SMyp)) of the list LS1 (s.

[0523] D1.2), where Syi (recognized as SMyi, i≦p) are just appeared situations which are expected when sub-activity, su-act(SMy,SMyj), in ZuA(AVy), is being executed, do:

[0524] if the execution of the sub-activity su-act(SMy,SMyj) is finished, i.e. a situation SMyi is successor (in the activity schema AVy) of the node SMy then begin update ZuA(AVy) in Lexint;

[0525] delete pointer P(Lexint,ZuA(AVy)) in the relevant lists PAH, LCMR, LuA;

[0526] if processor PrA is actually performing control-activity contr-su-actj of this sub-activity then begin close this control-activity; PAH :=nil end;

[0527] if the execution of the activity AVy is finished then begin close the execution of the activity AVy;

[0528] put the reached final situation SMyi of the activity AVy in the list LS2, as given in D1.3;

[0529] if AVy performed a command and SMyi is a goal situation then apply the rule RWAN3 (Sect. 3.3);

[0530] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bet(aS,b, t), des(aS,b,t) and other emotion intensities, in the case “activity AVy is finished and its final situation SMyi is reached”;

[0531] delete the element ES1(AVy) in LS1 and ZuA(AVy) in Lexint end else begin

[0532] apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bet(aS,b,t), des(aS,b,t) and other emotion intensities, in the case “between situation SMyi of the activity AVy is reached”;

[0533] su-act(SMyi,SMy2e):=the next sub-activity of the activity AVy, which will be executed, such that motsu-act(SMyi,SMy2e,t)=max(motsu-act(SMyi,SMy2n,t), for each successor SMy2n of the node SMyi, such that the resources for execution of the sub-activity su-act(SMyi, SMy2n) will be available), (motsu-act is defined in Sect. 3.2);

[0534] update ZuA(AVy) in Lexint and put the pointer P(Lexint,ZuA(AVy)) in the relevant list LuA, LuMR or LuCO;

[0535] using the expected situations given in su-act(SMyi,SMy2e), build the list exOSa(AVy,su-act(SMyi,SMy2e)) of objects and simple situations which can appear when this sub-activity is being executed;

[0536] update the list EOSa(Mas2e) in the object Qx (if this list is not in Qx then build it) in which the object Mas2e is being, where Mas2e is the object (e.g. machine, agent, processor PrA) which will execute this sub-activity and EOSa(Mas2e) is element of the list LOSa(Qx);

[0537] if su-act(SMyi,SMy2e) contains control-activity contr-su-acty2e then begin aty2e :=0 (in contr-su-acty2e);

[0538] put the pointer to contr-su-acty2e, in ZuA(AVy), into the list LuA end end end;

[0539] D3.3. control whether the duration of execution of a sub-activity lasts too long as follows:

[0540] sn :=sn+1; Lf sn>sn1 then begin

[0541] for each state ZuA(AVx) in Lexint do begin

[0542] if the sub-activity in ZuA(AVx) is executed (without interruptions) longer than ta2xj, where ta2xj is the maximum time period of execution of this sub-activity then begin

[0543] abandon the execution of this sub-activity and the activity AVx;

[0544] put ZuA(AVx) in the list LabD and delete ZuA(AVx) in Lexint;

[0545] update relevant lists PAH, LuA, LCMR, LuCO, LuMR end end end;

[0546] D4. control activities which are waiting for execution as follows:

[0547] D4.1. control whether the duration of execution of an activity lasts too long as follows:

[0548] an :=an+1; if an>an1 then begin

[0549] for each state ZuA(AVx) in Lexint do begin

[0550] if activity AVx is executed (without interruptions) longer than 1.3*tax, where tax is the time period needed for execution of this activity then begin abandon the execution of the activity AVx;

[0551] put ZuA(AVx) in the list LabD and delete ZuA(AVx) in Lexint;

[0552] update relevant lists PAH, LuA, LCMR, LuCO, LuMR end end end;

[0553] D4.2. control sub- and control-activities registered in the list LuA, which are waiting for execution by processor PrA as follows:

[0554] let EuA(AVy)=(P(Lexint,ZuA(AVy)),axy, . . . ) be an element of the list LuA, where axy=‘act’ if PrA should perform the sub-activity in ZuA(AVy), axy=‘co-a’ if PrA should perform the control-activity in ZuA(AVy);

[0555] let, for elements EuA(AVy) in LuA,

[0556] mots4-a(AVy,SMyi,SMyj,t)=motsu-act(AVy,SMyi,SMyjit), if axy=‘act’ (s. Sect. 3.2)

[0557] =mot-cont(AVy,SMyi,SMyj,tyj,t), if axy=‘co-a’ (s. end of Sect. 2.3)

[0558] where tyj denotes the duration of execution (without interruptions) of the sub-activity in ZuA(AVy), after the last control;

[0559] if the software Ex-contr-motion of the processor PrA has interrupted sub- or control-activity of an activity AVx (this information is in PAH) then put new element EuA(AVx) in LuA;

[0560] update ZuA(AVx) in Lexint; PAH:=nil end;

[0561] if processor PrA is free and LuA≠ nil then begin choose the element EuA(AVg), from the following set MuA, with the maximum value mots-c-a(AVg,SMgi,SMgi,t),

[0562] MuA={EuA(AVy) | the sub- or control-activity, s-c-ayj, in EuA(AVy), can be executed by the processor PrA (when aS, i.e. PrA, before executes some motion activities BAy1; . . . ; BAya) and the resources for execution of s-c-ayj are available};

[0563] let BAg1; . . . ; BAga are the mentioned motion activities which PrA has to perform before s-c-ag; register BAF=BAg1; . . . ; BAga;s-c-agj (for execution) in PAH (i.e. H2:=axg; H11:=the pointer to BAF; H5:=nil, etc.);

[0564] update ZuA(AVg) in Lexint and delete element EuA(AVg) in LuA end else

[0565] begin if LuA ≠ nil then begin choose the element EuA(AVg), from the following set MA1, with the maximum value mots-c-a(AVg,SMgi,SMgjt),

[0566] MA1={EuA(AVy) | the sub- or control-activity, s-c-ayj, in EuA(AVy), can be executed by the processor PrA (when aS, i.e. PrA, before executes motion activities BA1; . . . ; BAya) and the resources for execution of s-c-ayj will be available if the sub- or control-activity (su-co-actaw in ZuA(AVa)), which actually is being performed by PrA, is interrupted};

[0567] if mots-c-a(AVg,SMgi,SMgi,t)>1.35* mots-c-a(AVa,SMav,SMaw,t) then begin order the software Ex-contr-motion (in PrA) to interrupt the execution of su-co-actaw end end end;

[0568] D4.3. control sub-activities, registered in LuCO, waiting for execution by a processor PrCOn as follows:

[0569] begin if LuCO ≠ nil then begin nex :=false;

[0570] repeat choose element EuCO(AVg), from the list LuCO, with the greatest value motsu-act(AVg,SMgi,SMgi,t) (motsu-act is defined in Sect. 3.2), where su-act(SMgi,SMgi) is in ZuA(AVg);

[0571] if a processor PrCOf (1≦f≦ip) is free then m:=f else begin choose element ECMR(AVs), from the following set MC, with the minimum value motsu-act(AVs,SMse,SMsv,t)

[0572] MC={ECMR(AVy) is in LCMR| ECMR(AVy)=(P(Lexint,ZuA(AVy)), PrCOn, ‘activ’, . . . ), 1≦n≦ip, and the sub-activity su-act(SMye,SMyv) (in ZuA(AVy)) can be interrupted};

[0573] if such element ECMR(AVS) is chosen and motsu-act(AVg,SMgi,SMgi,t)>1.15*motsu-act(AVs,SMse,SMsv,t) then begin interrupt the execution of the sub-activity su-act(SMse,SMsv) being executed by the processor PrCOm, where ECMR(AVS)=(.,PrCOm, ‘activ’, . . . );

[0574] delete the element (P(Lexint,ZuA(AVs)), ‘co’) in LuA or PAH, if such element is there;

[0575] delete element ECMR(AVs) in LCMR and put the pointer P(Lexint,ZuA(AVs)) in the list LuCO;

[0576] update ZuA(AVs) in Lexint and update the node KTOS(PrCOm) end else nex:=true end;

[0577] if nex=false then begin put the element (P(Lexint,ZuA(AVg)), PrCOm, ‘activ’, . . . ) in LCMR;

[0578] delete the element EuCO(AVg) in LuCO and update the node KTOS(PrCOm);

[0579] if the sub-activity in ZuA(AVg) contains control-activity then put the element (P(Lexint,ZuA(AVg)), ‘co-a’) in the list LuA;

[0580] update ZuA(AVg) in Lexint and begin to execute the sub-activity in ZuA(AVg) by the processor PrCOm end until nex=true or LuCO=nil end end;

[0581] D4.4. control sub-activities registered in the list LuMR, waiting for execution by an object, Maxj, (machine, robot, agent, emotional system), as follows: begin LuM1:=LuMR;

[0582] for each Element ECMR(AVx) in LCMR do begin

[0583] if ECMR(AVx)=(.,Maxj, ‘interup-st’, . . . ) (i.e. when Maxj received, from DKA order “interrupt the sub-activity which is in ZuA(AVx)”) then begin

[0584] if in the list ES2(Maxj) or amS(Maxj) or apOS(Maxj) (in node KTOS(Maxj)) is the state “Maxj has interrupted the sub-activity, sub-acxj, (which is actually in ZuA(AVx))” then begin

[0585] delete the control-activity, given in sub-acxj, in the relevant list PAH or LuA;

[0586] put EuMR(AVx) in LuMR and delete ECMR(AVx) in the list LCMR;

[0587] update ZuA(AVx) and put the engagement state ‘free’ in node KTOS(Maxj);

[0588] mark the resources, Rxve, which were used by the sub-activity sub-acxj as ‘free’ end end end;

[0589] while LuM1 ≠ w nil do begin choose the element EuM1(AVg)=(P(Lexint,ZuA(AVg)),Magi, . . . ), from the list LuM1, with the maximum value motsu-act(AVg,SMgi,SMgi,t);

[0590] let Resgi are the resources needed for execution of the sub-activity su-act(SMgi,SMgi);

[0591] if object Magi is free and resources Resgi are free then begin

[0592] put element ECMR(AVg)=(P(Lexint,ZuA(AVg)),Magi, ‘activ’, . . . ) in LCMR;

[0593] if su-act(SMgi,SMgi) contains control-activity then put (P(Lexint,ZuA(AVg)), ‘co-a’, . . . ) in LuA;

[0594] for objects Rgie in Resgi, update KTOS(Rgie)—e.g. engagement state :=‘engag’;

[0595] update ZuA(AVg) in Lexint, and delete the elements EuMR(AVg) in LuMR and EuM1(AVg) in LuM1;

[0596] update KTOS(Magi)—e.g. engagement state :=‘engag-activw’;

[0597] begin the execution of the sub-activity su-act(SMgi,SMgi) by the object Magi end else

[0598] begin if in LCMR is no element (.,Magi, ‘interupst’, . . . ) then begin

[0599] search for element ECMR(AVs)=(P(Lexint,ZuA(AVs)),Magi, ‘activ’, . . . ) in LCMR such that: (a) when the sub-activity in ZuA(AVs) is interrupted then resources Resgi will be free, (b) motsu-act(AVg,SMgi,SMgi,t)>1.35* motsu-act(AVs,SMsu,SMsw,t);

[0600] if such element ECMR(AVS) is determined then begin

[0601] command Magi to interrupt the execution of the sub-activity su-act(SMsu,SMsw);

[0602] put ‘interup-st’ in ECMR(AVs) and update ZuA(AVs) end end;

[0603] delete EuM1(AVg) in the list LuM1 end end end;

[0604] D5. handle each foreseen situation, which just has appeared in an object in TOS and is registered in the list LS2 (built in D1.3 and D3.2), as follows:

[0605] actmamot :=max(motacty, for activities AVy in Lexint, where motacty is in ZuA(AVy) and denotes the motivation to execute the activity AVy);

[0606] for each element ES2(Q)=(Q,M(Q),(as1,Sa1,SMa1,.,.), . . . , (ask,Sak,SMak,.,.)) in LS2 (s. (5.1)) do begin for each situation SMae in ES2(Q) do begin

[0607] if SMae belongs to a situation sequence, FSh, in Q then register in FSh that SMae has appeared;

[0608] AK1:={AVy is in AK(SMae) (s. Sect. 3.1) | activity AVy is in one of the following lists LA1, . . . , LA4 in object model M(Q) (s. Sect. 2.2): (‘ex-act’.,.,LA1, . . . ), (‘useact’,.,.,LA2, . . . ), (‘act-in’.,.,LA3, . . . ), (‘act-rem’, .,.,LA4, . . . )};

[0609] acf :=true; while AK1 ≠ Ø and acf=true do begin

[0610] choose activity AVp, from AK1, with the greatest motivation, motactp, determined by the operation mot(aS,SMae,AVp,t,motactp,pg,SMg,t2,art,zvp) (s. Sect. 3.1);

[0611] if motactp>0.25*actmamot then begin

[0612]  if resources for execution of the activity AVp are available then begin acf :=false;

[0613]  put the element (‘ac-sit’,SMae,AVp,.,.) in the list LAst and delete (ase,Sae,SMae, . . . ) in ES2(Q)

[0614]  end else begin search for activities AVx1, . . . , AVxr, in the lists PAH and LCMR, such that: (a) if the sub-activities in ZuA(AVxi), i≦r, are interrupted then the resources for execution of the activity AVp will be free, (b) motactp>1.3*motactxi, for i=1, . . . , r, where motactxi is in Zua(Vxi) and denotes the motivation to execute activity AVxi;

[0615] if such activities AVx1, . . . , AVxr are determined then begin put (‘ac-sit’,SMae,AVp, . . . ) in the list LAst and delete (ase,Sae,SMae,.,.) in ES2(Q); acf=false end else

[0616] delete AVp in AK1 end end else acf=false end end end;

[0617] D6. handle not foreseen situations which just have appeared in structured objects, Q, in TOS and are registered in the list LnexS (s. D1.5) as follows:

[0618] actmamot :=max(motacty, for activities AVy in Lexint, where motacty is in ZuA(AVy) and denotes the motivation to execute the activity AVy);

[0619] for each element EnexS(Q)=(Q,M(Q),(as1,Su1,SMu1,.,.), . . . , (ass,Sus,SMus,.,.)) in LnexS do begin

[0620] for each situation (Sui,SMui) in EnexS(Q) do if |rosa(aS,SMui,t)|>500 then inform: “unexpected situation (Sui,SMui) has appeared in object Q”;

[0621] Ene1:=EnexS(Q); acs:=true; Aa :=Ø; while acs=true do begin

[0622] AKU :={AVr|a situation SMure in En1 is initial situation of the activity AVr, and AVr is not in Aa and occurs in the list (‘act-in’,.,.,LA3, . . . ) or (‘act-rem’,.,.,LA4, . . . ) occurring in object model M(Q) or clo(M(Q))};

[0623] if AKU ≠ Ø then begin choose activity, AVg, from AKU, with the greatest motivation, motactg, determined by the operation mot(aS,SMuge,AVg,t,motactg,px,SMx,t2,art,zvg) (s. Sect. 3.1);

[0624] if motactg>0.2 *actmamot then begin

[0625]  if resources for execution of the activity AVg are free then begin Aa :=Aa ∪ (AVg);

[0626]  put the element (‘ac-sit’,SMuge,AVg,.,.) in the list LAst, to execute AVg, and delete (ase,Suge,SMuge, . . . ) in Ene1 end else

[0627] begin search for activities AVx1, . . . , AVxd, in the lists PAH and LCMR, such that: (a) if the sub-activities in ZuA(AVxi), 1≦d, are interrupted then the resources for execution of the activity AVg will be free, (b) motactg>1.2* motactxi, for i=1, . . . , d, where motactxi is in Zua(Vxi) and denotes the motivation to execute activity AVxi;

[0628]  if such activities AVx1, . . . , AVxd are determined then begin Aa:=Aa ∪ {AVg};

[0629]  put (‘ac-sit’,SMuge,AVg, . . . ) in the list LAst, and delete (ase,Suge,SMuge,.,.) in Ene1, end else

[0630]  Aa :=Aa ∪ {AVg} end end else acs:=false end else acs :=false end end;

[0631] D7. handle objects and situations, in the list LOSf (with elements EOSt(Q), s. D1.6), which have not appeared in structured objects in TOS, although they should be there now, as follows:

[0632] actmamot:=max(motacty, for activities AVy in Lexint, where the motivation motacty is in ZuA(AVy));

[0633] for each element EOSf(Q)=(Q,M(Q), ob (pr(Of1),M(Of1)), . . . , (pr(Of a),M(Of a)); sit (pr(Sf1),SMf1), . . . , (pr(Sfd),SMfd)) in LOSf do begin build the following situations:

[0634] SOfi :=object M(Ofi) is not appeared in object Q although it should be there now with probability pr(Ofi), for i=1, . . . , a;

[0635] SMFe :=situation SMfe is not appeared in object Q although it should be there now with probability pr(Sfe), for e=1, . . . , d;

[0636] increase the attention to situations SOfi, i=1, . . . , a, and SMFe, e=1, . . . , d, according to the relevant rules given in [AS6]; apply the relevant rules, given in Sect. 2.1, in [AS6] and in [AS5], to update the relevant values bef(aS,b,t), des(aS,b,t) and other emotion intensities, with respect to the appeared situations SOf, i=1, . . . , a, and SMFe, e=1, . . . , d;

[0637] WSF :={SF| SF=SOfi, i≦a, and |rosa(aS,SOfi,t)|>10 or SF=SMFe, e≦d, and |rosa(aS,SMFe,t)|>10} (situations which are not in WSF are unimportant for aS);

[0638] for each situation SF in WSF do if |rosa(aS,SF,t)|>500 then inform: “situation SF has arisen”;

[0639] A1:={AV| ZuA(AV) is in the list Lexint or AV is in LAst and the execution of the activity AV began or begins from a situation in WSF};

[0640] acs:=true; while acs=true do begin

[0641] AKF :={AVf| a situation SFj in WSF is initial situation of the activity AVf and AVf is not in A1 and occurs in one of the following lists (‘use-act’,.,.,LA2, . . . ), (‘act-in’,.,.,LA3, . . . ), (‘act-rem’,.,.,LA4, . . . ) occurring in object model M(Q) or clo(M(Q))};

[0642] if AKF ≠ Ø then begin choose activity, AVg, from AKF, with the greatest motivation, motactg, determined by the operation mot(aS,SFgj;AVgt,motactg,px,SMxt2,art,zvg) (s. Sect. 3.1);

[0643] if motactg>0.3 *actmamot then begin

[0644]  if resources for execution of the activity AVg are available then begin A1 :=A1 ∪ {AVg};

[0645]  put the element (‘ac-sit’,SFgi,AVg,.,.) in the list LAst, to execute AVg, and delete the situation SFgi in WSF end else begin

[0646]  search for activities AVx1, . . . , AVxd, in the lists PAH and LCMR, such that: (a) if the sub-activities in ZuA(AVxi), i≦d, are interrupted then the resources for execution of the activity AVg will be available, (b) motactg>1.3 *motactxi, for I=1, . . . , d, where motactxi is in Zua(Vxi) and denotes the motivation to execute activity AVxi;

[0647]  if such activities AVx1, . . . , AVxd are determined then begin A1:=A1 ∪ {AVg};

[0648]  put (‘ac-sit’,SFgi,AVg, . . . ) in the list LAst, and delete SFgi in WSF end else

[0649]  A1 :=A1 ∪ {AVg} end end else acs:=false end else acs :=false end end.

REFERENCES

[0650] [InL] M. d'Inverno, M. Luck: Understanding agent systems; Springer-Verlag Berlin Heidelberg (2001).

[0651] [MeA] A. M. Meystel, J. S. Albus: Intelligent systems: architecture, design and control; John Wiley & Sons, New York (2002).

[0652] [JMü] J. P. Müller: The design of intelligent agents. a layered approuch; Lecture notes in artificial intelligence, Vol. 1177, Springer-Verlag Berlin Heidelberg, (1996).

[0653] [AS1] A. Schurmann: An Example of a motivated Agent; (15 pages), (1998).

[0654] [AS2] A. Schurmann: Cooperation in a motivated, Behaviour based Multi-Agent System; (16 pages), (1998).

[0655] [AS3] A. Schurmann: A simple thinking artificial Servant; (48 pages), (1998).

[0656] [AS4] A. Schurmann: An Idea how to define Semantics for a simple natural Language; (48 pages), (1999).

[0657] [AS5] A. Schurmann: Darstellung von Emotionen in elektronischen Geräten; international Patent Application No. PCT/DE00/03210; WIPO, internation. publication number WO 02/23474 A2, March 2002; submitted to Deutsches Patent- und Markenamt, München (February 2002), Application No. 100 85 105.3; English translation “Representation of emotions in electronic devices” is submitted to: (a) United States Patent and Trademark Office (March 2002), Application No. U.S. Ser. No. 10/089,369,(b) United Kingdom Patent Office (February 2002), Application No. GB 0204181.2.

[0658] [AS6] A. $,churmann: Determination der Befriedigung und des Verlangens in virtuellen Wesen; international Patent Application No. PCT/DE01/01416; WIPO, internation. publication number WO 02/084589 A1, October 2002; submitted to Deutsches Patent- und Markenamt, München (May 2002), Application No. 101 95 799.8; English translation “Determination of satisfaction and desire in virtual creatures” is submitted to: (a) United Kingdom Patent Office (May 2002), Application No. GB 0212672.0,(b) United States Patent and Trademark Office (June 2002), Application No. U.S. Ser. No. 10/149,247. 

1. Claimed is a method and a subsystem, called in the claims below “method DKA”, for determination and control of activities of a non-biological emotional system, denoted in the claims below by aS, comprising: i. the priority of execution of an activity or a command depends on the current motivation of the said emotional system aS to execute this activity or this command, respectively, where this motivation depends on needs, satisfactions and desires of the system aS, and goal situations of the said activity (said command respectively); ii. the method DKA uses activity models (called also activity schemas) which contain sub-activities, situation models, goal situations and stimulus patterns, where the said situation models belong to the below (in (v)) said graph SeG; iii. the control of execution of said activity or command is realized by execution of sub-activities and control-activities of the activity, or the command, respectively; iv. the priority of execution and control of said sub-activity depends on the motivation of the systems aS to execute this sub-activity, where this motivation depends on needs, satisfactions and desires of the system aS, and goal situations of the activity in which the said sub-activity occurs; v. the method DKA depends on the following components of the system aS: (a) needs of the systems aS, (b) intensities of satisfactions and desires of the system aS, with regard to the said needs of aS, (c) sub-system WP of the system aS for perception of objects and simple situations of the world of the system aS, (d) a set of said activity schemas which the system aS can execute, (e) a graph, SeG, (called below semantic graph) which contains the models of objects and situations appearing in the world of the system aS; vi. the object and situation models in the said semantic graph SeG contain stimulus patterns with regard to the said needs of the system aS; on the basis of these stimulus patterns and the intensities of satisfactions and desires of the system aS, the method DKA determines stimulus intensities of the perceived objects and situations; on the basis of the said stimulus intensities, the method DKA (thus, the system aS) can judge how good or how bad is an object or a situation for the system aS, at present time; vii. each said intensity of satisfaction and desire of the system aS concerns a said need of the system aS.
 2. Claimed is a method for determining the said, in claim 1, current motivation of the said system aS to execute a said, in claim 1, activity, comprising: i. this motivation is determined by: (a) the said, in claim 1, stimulus intensities of the goal and end situations of the said activity, (b) the intensities of satisfactions and desires of the system aS, at the present time and in the future, with regard to the said, in claim 1, needs of the system aS, (c) the said, in claim 1, needs of the system aS; ii. the said stimulus intensity of a goal or end situation of said activity is determined by: (a) the said, in claim 1, stimulus patterns in this goal or end situation, (b) the intensities of satisfactions and desires of the system aS, at the present time and in the future, with regard to the said, in claim 1, needs of the system aS; iii. on the basis of the said motivation to execute an activity, the method DKA (thus also the system aS) can judge how good or how bad is the execution of an activity for the system aS, at the present time.
 3. Claimed is a method for determining the said, in claim 1, motivation to execute a command comprising: this motivation is determined by: (a) the said, in claim 1 and 2, motivation of the said system aS to execute the activity which the said command concerns, (b) the said, in claim 1, needs of the system aS, especially by the following two needs: WA(Pa)—the need to perform and fulfil the commands and wishes of an authorized person, Pa, or an authorized system, Pa, AN—the need for recognition, acknowledgment and self-esteem, (c) the said, in claim 1, satisfactions and desires of the system aS, especially by the desire concerning the said need WA(Pa) and the desire for getting recognition and acknowledgment from the said Pa.
 4. Claimed are the said, in claim 1, activity schemas (or activity models, or in short: activities) comprising: i. an activity schema contains a graph, GA; the nodes of this graph are the said, in claim 1, situation models, and the arcs of this graph are the said, in claim 1, sub-activities, where these situation models belong to the said, in claim 1, semantic graph SeG, and sub-activity can contain a control-activity if this sub-activity should be executed by an other object (machine, agent, robot, computer or an other system); ii. said, in (i), control-activity of a said sub-activity is executed by the system aS in order to control the execution of the said sub-activity (by an other object); iii. some nodes of the said graph GA are goal situations of the said activity schema; iv. when the method DKA decides to execute an activity schema, then the said goal situations of the activity schema have positive stimulus intensities, for the system aS; v. the method DKA determines the priority of an activity by the said, in claim 1 and 2, motivation to execute this activity; vi. an activity scheme contains phrases—texts in a natural language—the meaning of which is the activity schema; on the basis of these phrases, the method DKA can name and express activities by words and simple sentences in a natural language.
 5. Claimed is a method for determining the said, in claim 1, motivation to execute a said, in claim 1 and 4, sub-activity which occurs in a said, in claim 1 and 4, activity, comprising: i. the said motivation to execute a sub-activity is determined by: (a) the said, in claim 1 and 2, stimulus intensities of the goal and end situations of the said activity, (b) the said, in claim 1 and 2, needs of the system aS, (c) the said, in claim 1 and 2, intensities of satisfactions and desires of the system aS, at the present time and in the future, with regard to the said needs of the system aS; ii. on the basis of the said motivation to execute a sub-activity, the method DKA (thus also the system aS) can judge how good or how bad is the execution of a said sub-activity for the system aS, at present time.
 6. Claimed is a method and a subsystem for said, in claim 1 and 4, control of execution of a said, in claim 1, 4 and 5, sub-activity by an other object (machine, agent, robot, computer or an other system), comprising: i. when a said sub-activity is not personally executed by the system aS, then this sub-activity can contain a said, in claim 4, control-activity—in this case, the method DKA (thus also the system aS) controls the execution of the sub-activity by an other object (e.g. agent, machine, robot); ii. the said, in (i), control-activity of a said sub-activity contains: (a) situation models for possible situations which can appear when the said sub-activity is being executed—as results of this execution, (b) elementary activities (e.g. motion activities, observation activities) which the system aS executes in order to recognize the said, in (a), situations and, eventually, to correct the execution of the said sub-activity by the said object; iii. the current priority of execution of the said control-activity is determined by the duration of the execution of this sub-activity after the last control, and by the said, in claim 1 and 5, motivation to execute the sub-activity in which the said control-activity occurs; iv. immediate after execution of the said control-activity, the said (in (iii)) priority equals zero ; this priority increases after that and can exceed the value of the motivation to execute the said, in (iii), sub-activity.
 7. Claimed is a subsystem of an emotional system aS, called below subsystem WP, for perception of objects and simple situations, comprising: i. the sensors of said subsystem WP are directed to these objects and situations, OS, in the surrounding of the subsystem WP (thus also of the system aS), for which the system aS, at present time, has high intensities of desires for attention (des(aS,AUw(OS),t) in the patent description) and curiosity/knowledge (des(aS,NEw(OS),t) in the patent description) with regard to the said objects and situations OS; ii. the said subsystem WP builds, by the internal representations of objects which the subsystem WP actually have perceived, a tree, TOS, such that: (a) each node, KtOS(O), of the tree represents an object, O, which has been recognized by the subsystem WP, (b) when the subsystem WP has recognized that an object, O, is in object Q, then node KTOS(O) is a successor of the node KTOS(Q) (which represents the object Q ), (c) when it is perceived that a situation is in object Q then this fact is registered in the node KTOS(Q); iii. the subsystem WP uses a graph, SeG, which represents the structure and relations of the object and situation models which represent the surrounding (the world) of the emotional system aS; an object or situation model, OSM, in graph SeG, contains phrases such that (a) each phrase in the model OSM is a word, a simple sentence or a pattern of a simple sentence in a natural language, (b) the meaning of the said phrases in model OSM is given (described) by the model OSM; this enables: the subsystem WP to perceive objects and situations only by the said phrases, the system aS to communicate by simple sentences in a natural language. 